Computers and Technology

Consider the problem of making change for n cents using the fewest number of coins. assume that each coin's value is an integer. [10 points] a) describe a greedy algorithm to make change consisting of quarters (25 cents each), dimes (10 cents each), nickels (5 cents each), and pennies (1 cent each). prove that your algorithm yields an optimal solution b) give a set of coin value combination (the value of coins may not be limited to quarter, dime, nickel, or penny) for which the greedy algorithm does not yield an optimal solution. use an example to justify your answer. note that your set should include a penny value so that there is a solution for every possible value of n

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:20, eagles2286
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
image
Computers and Technology, 22.06.2019 22:20, gingerham1
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, jason9394
Facial expressions and gestures are examples of messages.
Answers: 3
image
Computers and Technology, 23.06.2019 12:40, Emilyvite6251
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
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:

Konu
English, 12.12.2021 21:20