

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


a) What "greedy" algorithm would you use to solve this problem with US coin types of {1, 5, 10, 25, 50} and a change amount of 29-cents?
b) Do you get the correct solution if you use this algorithm for coin types of {1, 5, 10, 12, 25, 50} and a change amount of 29-cents?
a) For the coin-change problem, what determines the size of the problem?
b) How could we divide the coin-change problem for 29-cents into smaller problems?
c) If we knew the solution to these smaller problems, how would be able to solve the original problem?
29 cents
1-cent coin 5-cent coin 10-cent coin
12-cent coin 25-cent coin^ 50-cent coin Possible First Coin
Original Problem
Smaller problems
coin โCoinSet and coin change
29 cents
1-cent coin 5-cent coin 10-cent coin
12-cent coin 25-cent coin^ 50-cent coin Possible First Coin
Original Problem
Smaller problems