subject

NJIT decides to introduce its own coinage with three different types of coins: 1 cent, 5 cent, and 8 cents. We would like to know what is the minimum number of coins we can use if we pay for an item worth n cents. Give an efficient algorithm that if given n as input, it prints as output the minimum set of coins that has value exactly n. Analyze the time and space requirements of your algorithm. Prove its correctness. For example, you can pay an item worth 40 cents by giving five 8-cent coins; other alternatives is eight 5-cent coints, or forty 1-cent coins, or say four 8-cent, one 5-cent and three 1-centcoins.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
What is the first view you place in your drawing?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
All of these are true about using adhesive except: a. dissimilar materials can be joined. b. mixing tips are product and material specific. c. a specific application gun may be required. d. two-part adhesives are dispensed using two mixing tips
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
You know the right answer?
NJIT decides to introduce its own coinage with three different types of coins: 1 cent, 5 cent, and 8...
Questions
question
Mathematics, 25.02.2021 01:20
question
Mathematics, 25.02.2021 01:20
question
Mathematics, 25.02.2021 01:20
question
Mathematics, 25.02.2021 01:20
Questions on the website: 13722362