Question: (3 points) Consider the problem of making change for n cents using the least number of coins. Describe a greedy algorithm to make change consisting

 (3 points) Consider the problem of making change for n cents

(3 points) Consider the problem of making change for n cents using the least number of coins. Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pennies. Prove that your algorithm yields an optimal solution (3 points) Does your algorithm in part (b) give an optimal solution for any types of coin denominations di, d2,..., dk, for some integer k. Assume that each di is an integer and 1 is part of it. Note that part (b) has 4 types of coin denominations: 25, 10, 5, and 1. If your answer is yes then prove it, otherwise give a counter example

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!