Question: Consider the coin changing problem --- You are given some coins of different denominations say (1, 2, 3, ... , ) (all of them in

Consider the coin changing problem --- You are given some coins of different denominations say (1, 2, 3, ... , ) (all of them in cents) and you need to make a certain sum by picking the smallest number of coins. The following questions pertains to this problem

Design a greedy algorithm that solves this problem.

With a set of denominations (1,5,10,20,50) and = 37 what is the solutionreturned by the greedy algorithm? What is the optimal solution in this case?

With a set of denominations (1,5,10,20,25) and = 40 what is the solution returned by the greedy algorithm? What is the optimal solution in this case?

Consider the coin changing problem --- You are given some coins of

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!