Greedy Algorithms
Design greedy algorithms, prove them with exchange arguments, and recognize when a greedy rule fails.
3 objectives 6 steps about 115 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Solve scheduling and covering problems greedily (activity selection, minimum platforms, jump game, Huffman coding) by choosing a sort order or priority and a local rule.
- Write a short exchange or stays-ahead argument showing that a greedy algorithm returns an optimal answer.
- Construct a counterexample that breaks a plausible greedy rule, such as coin change with arbitrary denominations, and name the technique to use instead.
Lesson plan
6 steps, about 115 min · 0 of 5 lessons available so far
- Local Choices, Global Results Concept · 15 min · coming later
- Interval Scheduling and Its Proof Worked example · 25 min · coming later
- Writing an Exchange Argument Worked example · 20 min · coming later
- Lab: Huffman Codes with a Heap Lab · 25 min · coming later
- When Greedy Breaks Concept · 15 min · coming later
- Check: Greedy or Not? Knowledge check · 6 questions
Practise it
Solve activity selection, minimum platforms, minimum jumps to reach the end, and Huffman encoding with round-trip decoding; add a half-page exchange-argument proof for one of them and a failing input for a wrong greedy rule you were tempted to use.
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.