Intermediate Data Structures & Algorithms
Q45 / 100

What is the Floyd-Warshall algorithm used for?

Correct! Well done.

Incorrect.

The correct answer is B) Finding shortest paths between all pairs of vertices in O(V³)

B

Correct Answer

Finding shortest paths between all pairs of vertices in O(V³)

Explanation

Floyd-Warshall computes all-pairs shortest paths using dynamic programming in O(V³) time and O(V²) space. It handles negative edge weights but not negative cycles.

Progress
45/100