Question
The time complexity of computing the all-pairs shortest
paths in a dense graph with V vertices using Floyd–Warshall is:Solution
Floyd–Warshall updates distances via triple nested loops over vertices resulting in O(V³) time.
7Â Â Â Â Â Â 15Â Â Â Â Â Â Â 31Â Â Â Â Â Â 63Â Â Â Â Â Â 127Â Â Â Â Â Â ?
...61                          48                          ?                    ...
43Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 44Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 48Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ...
800    544    416    352    ?     304
15 12 ? 9 21 6
...32 63 121 ? 453 889
...100, 110, ?, 171.6, 240.24, 360.36
5Â Â Â Â 3Â Â Â Â Â 3Â Â Â Â Â 5Â Â Â Â Â 15Â Â Â Â ?
22 15 10 20 33 93.5
...If 4   x     4           7          15        38.5
Then,  ( x + 1) ( x - 1) = ?
...