Also called Biggest coin first and The cashier's algorithm.
fresh numbers
The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from greedy change-making's own run on the numbers shown.
choose one
1question 1
How many comparisons does greedy make paying 12 with coins of 8, 5 and 1?
the answer, and why
the answer is B
5 coins taken and 3 kinds: each coin that fits is one comparison, and each kind is one more when it no longer fits.