Guided lesson

Greedy Thinking

Problem Solving

Greedy Thinking

Practice pattern

Mental model

  • Must prove local choices lead to global optimum.

Operations

sort by rule

Cost shape

Often O(n log n) due to sorting

Watch out

Using greedy without proof.

Related algorithms

Activity SelectionMerge Intervals
Guided progression
10% lesson
Step 1 / 2Learner goal
Speech settings Speed 1.0 · Volume 90%

Keyboard: Space play/pause · Arrow keys step · Page Up/Down change sections · R restart