Algorithms | Analysis of Algorithms | Question 12
What is the time complexity of Floyd–Warshall algorithm to calculate all pair shortest path in a graph with n vertices?
(A) O(n^2logn)
(B) Theta(n^2logn)
(C) Theta(n^4)
(D) Theta(n^3)
Answer: (D)
Explanation: Floyd–Warshall algorithm uses three nested loops to calculate all pair shortest path. So, time complexity is Thete(n^3). Read here for more details.
Quiz of this Question
Recommended Posts:
- Algorithms | Analysis of Algorithms (Recurrences) | Question 4
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 8
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 7
- Algorithms | Analysis of Algorithms (Recurrences) | Question 9
- Algorithms | Analysis of Algorithms (Recurrences) | Question 3
- Algorithms | Analysis of Algorithms (Recurrences) | Question 2
- Algorithms | Analysis of Algorithms (Recurrences) | Question 1
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 6
- Algorithms | Analysis of Algorithms | Question 2
- Algorithms | Analysis of Algorithms | Question 1
- Algorithms | Analysis of Algorithms | Question 16
- Algorithms | Analysis of Algorithms | Question 8



