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

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 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 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!