Computers and Technology
Computers and Technology, 06.05.2020 03:05, yeehaw777

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. 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 of picking the largest denomination first always yields an optimal solution. You are expected to reason about why this approach gives an optimal solution. (Hint: Show that for each denomination ci, the optimal solution must have less than c coins.)

b. Design an Ο(nk) time algorithm that makes a change for any set of k different coin denominations, assuming that one of the coins is 3 cents in value.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:00, sdonachy7
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
image
Computers and Technology, 22.06.2019 16:30, buky0910p6db44
Corey set up his presentation for delivery to his team. the information he had to convey was critical to their job performance. he knew he would need a lot of time to explain each point
Answers: 3
image
Computers and Technology, 24.06.2019 04:30, minecrafter3882
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
image
Computers and Technology, 24.06.2019 12:00, violetagamez2
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
Do you know the correct answer?
Consider the problem of making change for n cents using the fewest number of coins. Assume that each...

Questions in other subjects: