Q28.Marks: +2.0UGC NET Paper 2: Computer Science 2nd January 2026 Shift 1
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:
1.A, C Only
2.B, C Only
3.A, B, C, D
4.B, D Only✓ Correct
Solution
The correct answer is B, D Only.
Key Points
Greedy algorithms make decisions based on the best immediate or local choice at each step.
They may not always lead to the optimal solution for every problem because they do not consider the global context.
Greedy algorithms often fail for problems where a local optimum does not guarantee a global optimum.
Unlike dynamic programming, they do not use a systematic approach to evaluate all possible choices, which limits their applicability to certain problems.
Key limitations of greedy algorithms include their reliance on local choices and their inability to handle complex problems that require forward planning.
Additional Information
Characteristics of Greedy Algorithms:
They work well for problems where a locally optimal choice leads to a globally optimal solution.
They are faster and more memory-efficient compared to dynamic programming but have limited applicability.
Examples of problems suited for Greedy Algorithms:
Huffman Coding: Used for lossless data compression.
Prim's Algorithm: Used to find the minimum spanning tree of a graph.
Activity Selection Problem: Used to select the maximum number of non-overlapping activities.
Why B and D are correct:
Option B is correct because greedy algorithms do not guarantee the optimal solution for all problems.
Option D is correct because greedy algorithms focus on local choices without considering future consequences.