A) T(n) = 3T(⌊n/2⌋) + n² (Master Method)
a = 3, b = 2, f(n) = n²
n^(log_b a) = n^(log₂ 3) ≈ n^1.585
Since f(n) = n² = Ω(n^(log₂ 3 + ε))
and regularity condition holds,
T(n) = Θ(n²)
Polynomially bounded.
B) T(n) = T(n − 1) + n² (Expansion)
T(n) = T(n−1) + n²
= T(n−2) + (n−1)² + n²
...
= T(0) + Σ i² (i = 1 to n)
Σ i² = Θ(n³)
T(n) = Θ(n³)
Polynomially bounded.
C) T(n) = T(⌊7n/8⌋) + 8n + 1 (Recursion Tree)
Level 0 cost: 8n
Level 1 cost: 8(7/8)n
Level 2 cost: 8(7/8)²n
...
Level k cost: 8(7/8)^k n
Height: (7/8)^k n = 1 ⇒ k = Θ(log n)
Total cost:
8n [1 + (7/8) + (7/8)² + ...] = Θ(n)
Polynomially bounded.
D) T(n) = 2T(n − 2) + 1 (Expansion)
T(n) = 2T(n−2) + 1
= 2²T(n−4) + (2 + 1)
...
= 2^k T(n−2k) + (2^k − 1)
n − 2k = 0 ⇒ k = n/2
T(n) = Θ(2^(n/2))
Exponential growth.
Not polynomially bounded.
Final Answer
Correct Option: D