GATE CS 2015 · Set-2 · Graph Traversals (BFS & DFS)

MCQ · 2 marks · Problem PROG-GRPH-0074

Given below are some algorithms, and some algorithm design paradigms.\[\begin{array}{ll} \text{1. Dijkstra's shortest path} & \text{i. Divide and Conquer} \\ \text{2. Floyd-Warshall (all pairs shortest paths)} & \text{ii. Dynamic Programming} \\ \text{3. Binary search on a sorted array} & \text{iii. Greedy design} \\ \text{4. Backtracking search on a graph} & \text{iv. Depth-first search} \\ & \text{v. Breadth-first search} \end{array}\]Match the above algorithms on the left to the corresponding design paradigm they follow.
  1. A
    1-i, 2-iii, 3-i, 4-v
  2. B
    1-iii, 2-iii, 3-i, 4-v
  3. C
    1-iii, 2-ii, 3-i, 4-iv
  4. D
    1-iii, 2-ii, 3-i, 4-v

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

Show the worked solution1. Dijkstra always finalises the closest unfinished vertex: Greedy design (iii).2. Floyd-Warshall builds answers from smaller subproblems (paths through vertices 1..k): Dynamic Programming (ii).3. Binary search halves the search range at each step: Divide and Conquer (i).4. Backtracking goes as deep as possible along one choice and backs up on failure: Depth-first search (iv).Answer: C

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