What is the time complexity of Floyd–Warshall algorithm to calculate all pair shortest path in a graph with n vertices?
(A)
O(n2log(n))
(B)
Theta(n2log(n))
(C)
Theta(n4)
(D)
Theta(n3)
Answer: (D)
Explanation:
Floyd–Warshall algorithm uses three nested loops to calculate all pairs shortest path. So, the time complexity is Theta(n3).
Please read here for more details.
Quiz of this Question
Please comment below if you find anything wrong in the above post

… [Trackback]
[…] Find More to that Topic: geeksforgeeks.org/algorithms-analysis-of-algorithms-question-12/ […]
… [Trackback]
[…] Read More on on that Topic: geeksforgeeks.org/algorithms-analysis-of-algorithms-question-12/ […]
… [Trackback]
[…] Here you will find 44455 additional Info on that Topic: geeksforgeeks.org/algorithms-analysis-of-algorithms-question-12/ […]
… [Trackback]
[…] Read More Info here on that Topic: geeksforgeeks.org/algorithms-analysis-of-algorithms-question-12/ […]