GATE CS 2017 · Set-1 · Graph Traversals (BFS & DFS)

MCQ · 1 mark · Problem PROG-GRPH-0063

Consider the following table:\[\begin{array}{|l|l|}\hline \textbf{Algorithms} & \textbf{Design Paradigms} \\\hline \text{(P) Kruskal} & \text{(i) Divide and Conquer} \\ \text{(Q) Quicksort} & \text{(ii) Greedy} \\ \text{(R) Floyd-Warshall} & \text{(iii) Dynamic Programming} \\\hline \end{array}\]Match the algorithms to the design paradigms they are based on.
  1. A
    P-(ii), Q-(iii), R-(i)
  2. B
    P-(iii), Q-(i), R-(ii)
  3. C
    P-(ii), Q-(i), R-(iii)
  4. D
    P-(i), Q-(ii), R-(iii)

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solution(P) Kruskal adds the cheapest edge that does not form a cycle at each step: Greedy, (ii).(Q) Quicksort partitions around a pivot and sorts the two parts recursively: Divide and Conquer, (i).(R) Floyd-Warshall builds shortest paths through intermediate vertices 1..k from those through 1..k-1: Dynamic Programming, (iii).Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com