Greedy Algorithms8 sections · 316 units
Open in Course

Common Greedy Patterns

Recognizing problem types

Most greedy problems fall into these categories:

1.1. Selection: : pick maximum items without conflict (activity selection)

2.2. Scheduling: : order tasks to minimize penalty or maximize profit

3.3. Interval: : merge, cover, or partition intervals

4.4. Exchange: : prove greedy by showing swaps do not hurt

5.5. Construction: : build solution piece by piece (Huffman coding) Recognizing the category helps you find the right approach. I will cover each in the following sections.