Question 148

Which algorithm finds the shortest paths between all pairs of vertices?

  1. AFloyd–Warshall
  2. BDijkstra
  3. CKruskal
  4. DPrim
Show answerHide answer

Correct answer: (A) Floyd–Warshall

Explanation

It uses dynamic programming in O(V^3).

From DSSSB TGT Computer Science Full Mock Test 5

This is question 148 of DSSSB TGT Computer Science Full Mock Test 5. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.