Question: Consider the problem of making change for n cents using the fewest number of coins. Assume that each coin's value is an integer. 2.
Consider the problem of making change for n cents using the fewest number of coins. Assume that each coin's value is an integer. 2. Suppose that the available coins are in the denominations that are powers of c, i.e., the denominations are e...e for some integers e> 1 and k 21. Show that the greedy algorithm always yields an optimal solution. 3. 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.
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
To make change for n cents using the fewest number of coins we can use the greedy algorithm The gree... View full answer
Get step-by-step solutions from verified subject matter experts
