Greedy Algorithms8 sections · 316 units
Open in Course

Summary: Greedy Problem Categories

Pattern recognition

Here are the main categories of greedy problems you have practiced:

1.1. Sorting-based:: Two City Scheduling, Activity Selection. Sort by some criterion, then select greedily.

2.2. Heap-based:: Connect Sticks, Task Scheduler. Use a heap to always pick the best available option.

3.3. Two-pointer:: Bag of Tokens, Assign Cookies. Process from both ends to maximize.

4.4. Range tracking:: Valid Parenthesis String. Track min and max possible values.

5.5. Reverse thinking:: Broken Calculator. Work backwards when forward is complex. Recognizing these patterns speeds up problem-solving significantly.