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, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
question
Computers and Technology, 22.06.2019 23:50
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
You know the right answer?
Consider the problem of making change for n cents using the fewest number of coins. assume that each...
Questions
Questions on the website: 13722362