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, 25.06.2019 00:30
Which of these serves as a bridge between the programming team and the audio team?
Answers: 2
question
Computers and Technology, 25.06.2019 07:00
Quick styles allow you to format an entire document quickly? t/f
Answers: 1
question
Computers and Technology, 25.06.2019 18:30
If you like to spend time outdoors working with plants and animals, you have a(n) a. bodily/kinesthetic learning style b. intrapersonal learning style c. visual/spatial learning style d. naturalistic learning style
Answers: 1
question
Computers and Technology, 26.06.2019 01:30
How to invite someone to a conversartion on
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
Questions on the website: 13722363