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 21:00
Describir textbook icon_person mira los dibujos y describe lo que estΓ‘ pasando. usa los verbos de la lista.
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
This graph compares the cost of room and board at educational institutions in texas.
Answers: 1
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
It is not necessary to develop strategies to separate good information and bad information on the internet. true or false
Answers: 1
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, 11.01.2021 20:40
question
History, 11.01.2021 20:40
question
Arts, 11.01.2021 20:40
Questions on the website: 13722361