1
answer
1
watching
198
views
jonasLv1
16 Dec 2022
Suppose you open a small shop and can't pay electronically. There are only four kinds of coins in the cashbox: 25 cents, 10 cents, 5 cents and 1 cent. If you are a salesperson and want to change 41 cents for customers, how can you arrange to give customers the right amount of money and the least number of coins?
The idea:Take the coin with largest denomination without exceeding the remaining amount of cents, make the locally best choice at each step.
Suppose you open a small shop and can't pay electronically. There are only four kinds of coins in the cashbox: 25 cents, 10 cents, 5 cents and 1 cent. If you are a salesperson and want to change 41 cents for customers, how can you arrange to give customers the right amount of money and the least number of coins?
The idea:Take the coin with largest denomination without exceeding the remaining amount of cents, make the locally best choice at each step.
1
answer
1
watching
198
views
For unlimited access to Homework Help, a Homework+ subscription is required.
Liked by jonas and 1 others
16 Dec 2022