The Recursion Tree Method is a way of solving recurrence relations. In this method, a recurrence relation is converted into recursive trees. Each node represents the cost incurred at various levels of recursion. To find the total cost, costs of all levels are summed up.

Steps to solve recurrence relation using recursion tree method:

  1. Draw a recursive tree for given recurrence relation
  2. Calculatethe cost at each level and count the total no of levels in the recursion tree.
  3. Count the total number of nodes in the last level and calculate the cost of the last level
  4. Sum up the cost of all the levels in the recursive tree

Let us see how to solve these recurrence relations with the help of some examples:

Question 1: T(n) = 2T(n/2) + c

#algorithms #gate cs #recursion #algorithms-analysis of algorithms (recurrences) #time complexity

How to solve time complexity Recurrence Relations using Recursion Tree method?
1.90 GEEK