Question: Consider the problem of making change for n cents using the fewest number of coins. Assume that each coin's value is an integer. a. Describe
a. Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pennies. Prove that your algorithm yields an optimal solution.
d. Give an O (nk)-time algorithm that makes change for any set of k different coin denominations, assuming that one of the coins is a penny.
Step by Step Solution
3.45 Rating (148 Votes )
There are 3 Steps involved in it
Before we go into the various parts of this problem let us rst prove once and for all that the coinchanging problem has optimal substructure Suppose w... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
C-S-A (102).docx
120 KBs Word File
