Computer Science EngineeringHard

Which of the following algorithms can detect a negative-weight cycle reachable from the source?

  1. A. Dijkstra
  2. B. Prim
  3. C. Kruskal
  4. D. Bellman-Ford

Correct answer: D. Bellman-Ford

If a further relaxation is possible after V-1 passes, Bellman-Ford reports a negative cycle.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic