BTI Beyond The Interviews

DSA · 9 sections

Greedy Algorithms

When local optimal choices lead to global optimum — and how to prove it.

Premium · preview 98 cards Updated 24 Oct 2026
Free to preview. The first 3 cards and the full outline are below — the rest of this sheet is part of the DSA & Data Structures bundle.

What's inside

Preview — first 3 of 98 cards

Greedy choice property

A globally optimal solution can be assembled by making the locally optimal (greedy) choice at each step. You must prove a global optimum contains such a choice.

Optimal substructure

After making the greedy choice, the remaining subproblem is itself optimal; combining it with the choice yields the global optimum. Both properties are needed.

Greedy vs DP

Greedy commits to one choice with no backtracking; DP explores all choices and memoizes. Greedy is often faster (O(n) or O(n log n) depending on sorting/heaps) but only valid when the greedy-choice property holds.

95 more cards in this sheet

Unlock the DSA & Data Structures bundle — ₹399

One-time payment. Unlocks this sheet and 8 other sheets in the bundle, plus a typeset PDF of each.

Unlock the bundle See all bundles

Or get all 76 sheets for ₹999 — one payment, every future sheet included.