The correct matching for the following pairs is
View worked solution
Answer: B
We can determine the correct matching by analyzing the design paradigm or algorithmic technique associated with each problem:
- A. All pairs shortest path (3): The standard algorithm for this problem is the Floyd-Warshall algorithm, which is a classic example of Dynamic Programming.
- B. Quick Sort (4): Quick Sort works by partitioning an array into subarrays around a pivot and recursively sorting them, which is a textbook Divide and Conquer strategy.
- C. Minimum weight spanning tree (1): Algorithms like Kruskal's and Prim's construct the minimum spanning tree by making locally optimal choices at each step, which is a Greedy approach.
- D. Connected Components (2): Finding connected components in a graph is typically done using graph traversal algorithms, such as Depth-First Search (DFS) or Breadth-First Search (BFS).
Thus, the correct matching is:
A-3, B-4, C-1, D-2, which corresponds to Option B.
Free practice · Your answers on this page are not saved.
