Computer Science EngineeringHard

The Floyd-Warshall all-pairs shortest path algorithm runs in time

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

Correct answer: B. O(V^3)

It uses three nested loops over the V vertices.

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

Exams that ask this topic