Showing 6 of 6 questions
Easy: 0
Medium: 0
Hard: 0
Overview
Greedy algorithms make the locally optimal choice at each step with the hope of finding the globally optimal solution. This section covers greedy strategies for scheduling, interval, and optimization problems.
Key Concepts
- Greedy choice property
- Optimal substructure
- Activity selection and scheduling
- Interval problems
- Two-pass greedy strategies
- Proof of correctness (exchange argument)
Common Problems
Medium
- Jump Game
- Jump Game II
- Gas Station
- Task Scheduler
- Minimum Number of Platforms
Hard
- Candy
- Minimum Number of Arrows to Burst Balloons
- Non-overlapping Intervals
Practice Tips
- Prove greedy works: Use exchange argument or show greedy stays ahead
- Sort first: Many greedy problems require sorting the input
- Consider counterexamples: Before committing to greedy, check if it fails
- Compare with DP: If greedy doesn’t work, try dynamic programming