subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Consider jasper’s balance sheet. which shows how to calculate jasper’s net worth?
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
The database design steps are listed below in the incorrect order. choose the correct order number next to each step. determine the information to be stored in the database. determine the fields needed to record the data determine if there will be any repetition of data entered, and separate the fields into tables to normalize the data. create relationships to connect the tables.
Answers: 3
question
Computers and Technology, 25.06.2019 01:00
When a new name is registered on the internet, the process can take two hours to four hours four hours to three days two hours to two days one hour to eight hours
Answers: 1
You know the right answer?
Consider the problem of making change for n cents using the fewest number of coins. assume that each...
Questions
question
French, 28.08.2020 21:01
question
Mathematics, 28.08.2020 21:01