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, 21.06.2019 23:00
What computer network component allows data transfers from one computer to another through a telephone line?
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
question
Computers and Technology, 24.06.2019 10:30
Which of the following types of software is most applicable to the promotion of new products through advertising? a.databases b. spreadsheets c. web design programs d. word processing tools
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, 20.01.2022 14:00
question
History, 20.01.2022 14:00
question
Mathematics, 20.01.2022 14:00
question
Mathematics, 20.01.2022 14:00
Questions on the website: 13722360