Stop 18 · Data Structures & AlgorithmsTopics · 14/17

Greedy

Part of the Full Stack Developer Roadmap

In short

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

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

More topics at this stop

Stuck on this topic? Ask an Insider

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

Download
InsideEdge