Which of the following are limitations of Greedy algorithms? A. They always…
2026
Which of the following are limitations of Greedy algorithms?
A. They always fail for NP hard problem.
B. They may not give the optimal solution for all problems.
C. They are faster than dynamic programming in most cases.
D. They make local choices without looking ahead.
Choose the correct answer from the options given below:
A, C Only
B, C Only
A, B, C, D
B, D Only
- A.
1
- B.
2
- C.
3
- D.
4
Attempted by 191 students.
Show answer & explanation
Correct answer: D
The correct answer is:
B and D
Explanation:
A. Incorrect
Greedy algorithms do not always fail for NP-hard problems. In fact, they are often used to find approximate solutions for such problems.B. Correct
Greedy algorithms may not always produce the optimal solution unless the problem has the greedy-choice property (e.g., Dijkstra's Algorithm works, but not all problems do).C. Incorrect
While greedy algorithms are often faster than dynamic programming, this is not a limitation. It’s actually an advantage.D. Correct
Greedy algorithms make decisions based only on the current step (local optimum) without considering future consequences, which can lead to suboptimal results.