Home »
MCQs »
Algorithms MCQs
The time complexity of the Floyd-Warshall algorithm is ______.
29. The time complexity of the Floyd-Warshall algorithm is ______.
- O(V^2)
- O(V^2 + E)
- O(V^3)
- O(E^3)
Answer
The correct answer is: C) O(V^3)
Explanation
The Floyd-Warshall algorithm has a time complexity of O(V^3) due to its three nested loops over the graph vertices.