All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · June 2024 (Cancelled Exam)

f(n) = a·f(n/b) + g(n) is a divide-and-conquer recurrence. Match the algorithms in List I with their recurrences in List II.
List IList II
A. Binary SearchI. f(n) = 7f(n/2) + 15n²/4
B. Find maximum and minimum of a sequenceII. f(n) = 2f(n/2) + n
C. Merge SortIII. f(n) = 2f(n/2) + 2
D. Fast Matrix MultiplicationIV. f(n) = f(n/2) + 2

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. A-IV, B-III, C-II, D-I

Explanation

Binary search: f(n) = f(n/2) + 2 (IV). Max & min: f(n) = 2f(n/2) + 2 (III). Merge sort: f(n) = 2f(n/2) + n (II). Fast (Strassen) matrix multiplication: f(n) = 7f(n/2) + 15n²/4 (I).

More Data Structures and Algorithms questions