Question

Given below are some algorithms, and some algorithm design paradigms.

List-I

  1. Dijkstra's Shortest Path
  2. Floyd-Warshall algorithm to compute all pairs shortest path
  3. Binary search on a sorted array
  4. Backtracking search on a graph

List-II
i. Divide and Conquer
ii. Dynamic Programming
iii. Greedy design
iv. Depth-first search
v. Breadth-first search

Match the above algorithms on the left to the corresponding design paradigm they follow.

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2015 answer key

Solution

Match classic algorithms with their primary design paradigms.

Examine the algorithmic design paradigms:

  1. Dijkstra's Shortest Path: Repeatedly chooses the unvisited vertex with the minimum tentative distance   ⟹  \implies Greedy design (iii).
  2. Floyd-Warshall algorithm: Computes all-pairs shortest paths via optimal subproblems dij(k)=min⁡(dij(k−1),dik(k−1)+dkj(k−1))d_{ij}^{(k)} = \min(d_{ij}^{(k-1)}, d_{ik}^{(k-1)} + d_{kj}^{(k-1)})   ⟹  \implies Dynamic Programming (ii).
  3. Binary search on a sorted array: Recursively partitions the search range in half   ⟹  \implies Divide and Conquer (i).
  4. Backtracking search on a graph: Explores possible candidate solutions depth-first, undoing moves upon reaching dead ends   ⟹  \implies Depth-first search (iv).

The correct alignment is: 1-iii, 2-ii, 3-i, 4-iv (option C).

Final answer

C

Common trap

Classifying Dijkstra's algorithm as dynamic programming rather than greedy.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
46 of 65, printed as CS Q.36
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.