Question 35

Computer Awareness Data Structure Medium

Which of the following standard algorithms is not a greedy algorithm?

(A) Prim's algorithm
(B) Kruskal algorithm
(C) Dijkstra's shortest path algorithm
(D) Bellman-Food shortest path algorithm
View Dynamic Solution & Explanation
Correct Solution: Option D

Step-by-step Solution:

The Bellman-Ford shortest path algorithm is not a greedy algorithm. Unlike greedy algorithms, it uses iterative relaxation and can handle graphs with negative weights. \[\] \[\] Correct Option: (d)