Which of the following algorithms solves the all-pairs shortest path problem?
Show answerHide answer
Correct answer: (B) Floyd's algorithm
Explanation
Floyd's (Floyd-Warshall) algorithm finds shortest paths between every pair of vertices in O(V³). Dijkstra is single-source, Prim builds an MST, and Warshall finds transitive closure.