Greedy algorithms
Lesson 20 of 20 · Algo.Micro
Take the best-looking choice now. Sometimes perfect, sometimes a trap.
To pay 63 with coins of 50, 10, 5 and 1, take the biggest coin that fits, again and again: 50, 10, 1, 1, 1. Six coins, and here that is optimal.
Check yourself
What does a greedy algorithm do at each step?
Do it in the browser: a real algorithms tool, a short mission and instant feedback. No install.
Start this lesson — free