Recursion tree method is best than the Substitution method for solving a recurrence relation because in recursion tree method, we draw a recurrence tree and calculate the time taken by every level of tree. Finally, we sum the work done at all levels. To draw the recurrence tree, we start from the given recurrence and keep drawing till we find a pattern among levels. The pattern is typically a arithmetic or geometric series but in substitution method we make a guess for the solution and then we use mathematical induction to prove the guess is correct or incorrect.
Asymptotic Analysis of Recurrence Relation
Recurrence Relation:
Solution Using Recursion Tree Method
Step 1: Recursion Tree Structure
The recursion tree has:
- Root node cost:
- Two child nodes:
and - This pattern continues until reaching small subproblems
Step 2: Cost at Each Level
Level 0 (Root):
Level 1:
Level 2:
General Pattern:
Step 3: Summing Over All Levels
The total cost is an infinite geometric series:
With first term
Since
Step 4: Asymptotic Upper Bound
The root cost (
Final Answer
The asymptotic upper bound of the recurrence relation is: