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 15 with coins of 10, 6 and 1?
the answer, and why
the answer is D
6 coins taken and 3 kinds: each coin that fits is one comparison, and each kind is one more when it no longer fits.
if you chose another
AThat is the coins greedy pays, 10, 1, 1, 1, 1, 1.