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.
DSA · 9 sections
When local optimal choices lead to global optimum — and how to prove it.
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.
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 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.
What's new and the interview questions people are actually getting asked. No spam.