Question: 3 . Consider the problem of making changes for n cents using the fewest number of coins. Assume that each coin's value is an integer.
Consider the problem of making changes for n cents using the fewest number of coins. Assume that each coin's value is an integer. a Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pen XL nies. b Suppose that the available coins are in the denominations that are powers of c ie the denominations are c c ck for some integers c and k Describe a greedy algorithm. c 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 You only need to give at least one example.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
