Spot When Greedy Fails
Find counterexamples before trusting it.
Greedy Is Tempting
Greedy is short, fast, and feels obvious, which is exactly why it can trap you. A clean idea is not the same as a correct one. ⚠️
The Coin Change Trap
With coins 1, 3, and 4, making 6 greedily picks 4 then needs two 1s, totaling three coins. The real best is two 3s.
All lessons in this course
- The Greedy Mindset
- Activity Selection by Earliest Finish
- Fractional Knapsack by Ratio
- Spot When Greedy Fails