Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Compared to dynamic programming, greedy algorith…

Compared to dynamic programming, greedy algorithms are

Aalways slower because they explore more states
Balways equivalent in output but slightly different in code
Cfaster (no memo table) but only correct with the greedy-choice property
Dslower per step but correct on more problems
Answer & Solution
Correct answer: C. faster (no memo table) but only correct with the greedy-choice property
Greedy skips the memo table that DP maintains, which makes it faster. But it commits irrevocably to local choices, so it only works on problems where the locally best choice is globally safe. DP handles more problems (anything with optimal substructure); greedy handles fewer but with less overhead.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions