What is the running time of the Floyd Warshall Algorithm?

What is the running time of the Floyd Warshall Algorithm?
A. Big-oh(V)
B. Theta(V$^{2}$)
C. Big-Oh(VE)
D. Theta(V$^{3}$)
 
Answer: d
Explanation: The running time of the Floyd Warshall algorithm is determined by the triply nested for loops. Since each execution of the for loop takes O(1) time, the algorithm runs in time Theta(V$^{3}$).
 

Tìm kiếm

Back
Top