Phase 21 · Data Structures & Algorithms

Topics

Greedy

Part of the Backend Developer Roadmap.

Summary

An algorithmic approach that makes the locally optimal choice at each step, hoping (and sometimes provably) it leads to a globally optimal solution.

How to Learn This

  • 1Solve a classic greedy problem: activity selection or coin change (with certain coin sets).
  • 2Learn to recognize when greedy actually works vs when it gives a wrong answer.
  • 3Compare a greedy solution to a DP solution for the same problem when greedy fails.
InsideEdge

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — free on the InsideEdge app.

Download
InsideEdge