All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2022 (Shift 1)

For matrix multiplication with a simple divide-and-conquer algorithm: A. the running time is T(n) = Θ(n³) B. the running time is T(n) = Θ(n² log n) C. the recurrence is T(n) = 8T(n/2) + Θ(n²) D. the recurrence is T(n) = 8T(2n) + Θ(n² log n) E. one of the cases of the master theorem applies

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

Show answer & explanation

Correct answer: A. A, C, E only

Explanation

Splitting into n/2 blocks needs 8 recursive multiplications plus Θ(n²) additions: T(n) = 8T(n/2) + Θ(n²). Since n^(log₂8) = n³ dominates n², master theorem case 1 gives Θ(n³).

More Data Structures and Algorithms questions