Question
Given below are some algorithms, and some algorithm design paradigms.
List-I
- Dijkstra's Shortest Path
- Floyd-Warshall algorithm to compute all pairs shortest path
- Binary search on a sorted array
- 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.
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:
- Dijkstra's Shortest Path: Repeatedly chooses the unvisited vertex with the minimum tentative distance Greedy design (iii).
- Floyd-Warshall algorithm: Computes all-pairs shortest paths via optimal subproblems Dynamic Programming (ii).
- Binary search on a sorted array: Recursively partitions the search range in half Divide and Conquer (i).
- Backtracking search on a graph: Explores possible candidate solutions depth-first, undoing moves upon reaching dead ends Depth-first search (iv).
The correct alignment is: 1-iii, 2-ii, 3-i, 4-iv (option C).
C
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.