Practice free →
HomeGATE CSEcomputerscienceAlgorithms › The defining feature of a greedy algorithm is th…

The defining feature of a greedy algorithm is that it

Aexplores every possible solution before picking the best
Bpicks the locally best candidate at each step and never revisits it
Cmemoises sub-problem answers in a table
Duses randomness to escape local optima
Answer & Solution
Correct answer: B. picks the locally best candidate at each step and never revisits it
Greedy commits to the locally best choice at each step and never reconsiders. The lack of backtracking is what makes it fast. Exhaustive search is brute force; memoised sub-problems is dynamic programming; randomness is randomised algorithms. Greedy's strength and weakness both come from the no-backtracking commitment.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions