Question: Suppose you use a greedy algorithm to make change in the Kingdom of Hyrule. You have rupee gems worth 1 rupee, 4 rupees, 16 rupees

Suppose you use a greedy algorithm to make change in the Kingdom of Hyrule. You have rupee gems worth 1 rupee, 4 rupees, 16 rupees and 30 rupees What sequence of gems will you give someone if you owe them 37 rupees? Enter the denominations of rupee from first to last, using the values given above. If you do not need to use all of these rupees, enter a 0 for unused rupees. (For example, if you can make the given amount of change using only 4 rupees, enter 0 for #5 and #6) First rupee Second rupee Third rupee Fourth rupee Fifth rupee: Sixth rupee: Was this algorithm for making change optimal? Measure optimality in the sense of using the fewest number of rupees possible to make a given amount of change. (For example, using 4 one-rupee gems to make 4 rupees change is less optimal than using a single four-rupee piece.) Choose... >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
