Question Bank
/

Master Theorem Deep Dive

Master Theorem Deep Dive

Five prompts on T(n) = a*T(n/b) + f(n): identifying the three cases, applying them to merge sort and Strassen, and spotting when the theorem does not apply.

Question Bank
Hard
Python
master-theorem
recursion
big-o
algorithms

888 views

24

Apply the master theorem to the recurrence encoded by this function (a recursive calls each of size n/b, plus linear work). Identify a, b, f(n), the watershed, the case, and the final bound.

Examples

Example 1:

Input: a = 2, b = 2, f(n) = O(n)
Output: T(n) = Theta(n log n)
Explanation: Watershed is n^log_2(2) = n. Since f(n) = Theta(n) matches the watershed, Case 2 fires. This is exactly the merge sort recurrence.

4 more questions, with full solutions and explanations, are available for premium members.

Upgrade to Premium