Iteration Method for Solving Recurrences with example

Share

Recurrence:

The term Recurrence can be defined as any kind of inequality or equation that focuses on the value over the small inputs of the function. The running time of an algorithm with recursive calls can be easily described by recurrence. This is the reason that recurrence is often used in Divide-and-Conquer problems.

There are 3 ways of solving recurrence:

  • SUBSTITUTION METHOD – A guess for the solution is made, and then we prove that our guess was incorrect or correct using mathematical induction.
  • ITERATION METHOD – We need to draw each and every level of recurrence tree and then calculate the time at each level.
  • MASTER METHOD – In this method, we have some predefined recurrence equation cases, and our focus is to get a direct solution for it.

 

ITERATION METHOD

  • Firstly draw the recursion tree.
  • Calculate the time in each level of the recursion tree.
  • Sum up all the time values.

An example is given below to show the method in detail.

 

This post was last modified on September 29, 2020

Rupesh Rawat

Published by
Rupesh Rawat
Tags: daa design and algorithm analysis design and algorithm analysis iteration method Recurrences