subject

Suppose a greedy algorithm is used to return the smallest number of coins for a total of n cents, using coin denominations of 1, 2, and 4 cents. The algorithm selects one coin at a time, dispenses this coin, decreases n by the denomination of this coin, and proceeds in this fashion until n reaches zero. The greedy choice consists in always selecting a coin with the largest possible value. The required coins of given denominations are always available. Prove that this greedy algorithm always returns an optimal result.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What are ways to switch windows in excel? check all that apply. on the status bar, click the windows button, and then click the file name. on the task bar, click to display the excel jump list, and then click the file name. on the view tab, in the window group, click switch windows, and then click the file name. on the review tab, in the viewing group, click files, and then click the file name.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
You know the right answer?
Suppose a greedy algorithm is used to return the smallest number of coins for a total of n cents, us...
Questions
question
Biology, 22.04.2020 23:58
question
Mathematics, 22.04.2020 23:58
Questions on the website: 13722361