Question 37Asked in UGC NET Computer Science, December 2014 (Paper II & III, Selected Questions)

Dijkstra algorithm, which solves the single-source shortest-paths problem, is a ................, and the Floyd-Warshall algorithm, which finds shortest…

Dijkstra algorithm, which solves the single-source shortest-paths problem, is a ................, and the Floyd-Warshall algorithm, which finds shortest paths between all pairs of vertices, is a............
  1. AGreedy algorithm, Divide-conquer algorithm
  2. BDivide-conquer algorithm, Greedy algorithm
  3. CGreedy algorithm, Dynamic programming algorithm
  4. DDynamic programming algorithm, Greedy algorithm
Show answerHide answer

Correct answer: (C) Greedy algorithm, Dynamic programming algorithm

Explanation

Dijkstra's algorithm for the single-source shortest-paths problem is a greedy algorithm, and the Floyd-Warshall algorithm for all-pairs shortest paths is a dynamic programming algorithm.

From UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions)

This is question 37 of UGC NET Computer Science PYQ, December 2014 (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.