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 8 with coins of 6, 4 and 1?
the answer, and why
the answer is D
6 fits in 8, then 6 and 4 do not fit in 2, then two 1s fit and a third does not. 3 coins taken and 3 kinds.