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.
Keep practising Algorithms
Browse all Algorithms questions for GATE CSE, or explore more Computer Science topics.