Ask Question
Today, 05:02

Consider the problem of making change 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 pennies. Prove that your algorithm yields an optimal solution. b. Suppose that the available coins are in the denominations that are powers of c, i. e., the denominations are c0, c1, ..., ck for some integers c > 1 and k % 1. Show that the greedy algorithm always yields an optimal solution. 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. d. Give an O (nk) - time algorithm that makes change for any set of k different coin denominations, assuming that one of the coins is a penny.

+4
Answers (1)
  1. Today, 07:59
    0
    the answer is B ...
Know the Answer?
Not Sure About the Answer?
Find an answer to your 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. a. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers