Quiz

Greedy or Not?

A greedy algorithm makes the choice that looks best right now and never reconsiders. It's fast and often right, but not always.

A greedy cashier making change always grabs the biggest coin that fits, then repeats with what's left.

In a land with coins worth 1, 3 and 4, the greedy cashier makes change for 6. What happens?