Skip to content
BytePatterns

Greedy

Take the best local move and see exactly when that is enough.

Greedy progress0 / 5
  1. What Makes Greedy WorkTake the best move now — but only when it can never block a better answer.5m
  2. Interval SchedulingSort by finishing time and the room books itself.5m
  3. Jump GameCarry one number: the furthest index still in reach.5m
  4. Gas StationOne pass picks the start, because every failed prefix is proof.6m
  5. Huffman IntuitionMerge the two rarest symbols, again and again, and the code writes itself.6m

Quiz yourself: 3 questions from this module

1 / 3

What does a greedy algorithm never do?