Computer Science EngineeringHard

The Bellman-Ford single-source shortest path algorithm has running time

  1. A. O(V^2)
  2. B. O(E log V)
  3. C. O(VE)
  4. D. O(V+E)

Correct answer: C. O(VE)

It relaxes all E edges in each of V-1 passes.

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

Exams that ask this topic