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 06:00
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
George is working as a programming team lead. which statements correctly describe the skills that he requires?
Answers: 3
question
Computers and Technology, 24.06.2019 20:30
How is energy expended in active transport
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
How do i copy and paste equations and pictures like math graphs, to post on this site to get my questions answered?
Answers: 2
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
Physics, 18.03.2021 21:10
question
Mathematics, 18.03.2021 21:10
question
Mathematics, 18.03.2021 21:10
question
English, 18.03.2021 21:10