13 worked problems

Greedy

Take the locally best choice and never look back. A locally optimal choice can be proven never to reduce the quality of the remaining solution.

Recognition signal

When should you think of Greedy?

A locally optimal choice can be proven never to reduce the quality of the remaining solution.

Core invariant

What must stay true?

Processed choices form an optimal prefix that never needs to be reconsidered.

Practice in a deliberate order

What to learn in this cluster

  1. 01Simple one-pass choices
  2. 02Sort then choose
  3. 03Scheduling and exchange arguments

All Greedy problems

13 of 13 walkthroughs
Continue the cluster

Related patterns and study guides