Question 47Asked in UGC NET Computer Science, June 2015 (Paper II & III, Selected Questions)

An all-pairs shortest-paths problem is efficiently solved using :

  1. ADijkstra' algorithm
  2. BBellman-Ford algorithm
  3. CKruskal algorithm
  4. DFloyd-Warshall algorithm
Show answerHide answer

Correct answer: (D) Floyd-Warshall algorithm

Explanation

The Floyd-Warshall algorithm solves the all-pairs shortest-paths problem efficiently in O(n³) time using dynamic programming.

From UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions)

This is question 47 of UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions). 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.