Master Theorem, Recurrence Relations, Matrix Multiplication
Know WHY Strassen is faster (7 vs 8 multiplications) and how to apply Master Theorem to analyze it. You likely won't need to memorize the exact 7 formulas.
Doesn't apply to: T(n) = 2T(n/2) + n log n (gap isn't polynomial), or when a < 1, or b ≤ 1.
Key insight: Notice how quickly O(n²) and O(2ⁿ) grow compared to O(n log n). This is why divide & conquer algorithms like merge sort (O(n log n)) are much better than bubble sort (O(n²)) for large inputs!
Q1: For T(n) = 3T(n/4) + n, what is n^(log_b a)?
Q2: For T(n) = 3T(n/4) + n, which case applies?
Q3: For T(n) = 8T(n/2) + n², what is the solution?
Step 1: Identify a, b, f(n)
Step 2: Calculate n^(log_b a)
Step 3: Compare f(n) with n^(log_b a)
Step 4: Apply the case and get final answer
Try this one yourself! Click to reveal each step.
a = 2, b = 4, f(n) = √n = n^0.5
log₄2 = 0.5, so n^(log_b a) = n^0.5
f(n) = n^0.5 equals n^(log_b a) = n^0.5
Case 2 applies → T(n) = Θ(n^0.5 log n) = Θ(√n log n)