Question: Consider the coin changing problem: making change for n cents using the fewest number of coins, where we assume that each coin's value is an

Consider the coin changing problem: making change for n cents using the fewest number of coins, where we assume that each coin's value is an integer. For each of the following cases, give a set of coin denominations for which the greedy algorithm does not yield an optimal solution. Your set should include a penny so that there is a solution for every value of n.(Ideally, give an example for each case of the solution the greedy approach would yield contrasted with the optimal solution.)
Give a set of coin denominations using actual U.S. coins for which the greedy algorithm does not yield an optimal solution.
Give a set of coin denominations using the smallest integer numbers you can use for which the greedy algorithm does not yield an optimal solution.
the counter example you have provided is not correct for coin chnaging problem. provide me a perfect exape with explanation

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 Programming Questions!