Type 2 Linear Recurrence Relations

Following are some of the examples of recurrence relations based on linear recurrence relation.

T(n) = T(n-1) + n for n>0 and T(0) = 1

These types of recurrence relations can be easily solved using substitution method

For example,

T(n) = T(n-1) + n
= T(n-2) + (n-1) + n
= T(n-k) + (n-(k-1))….. (n-1) + n

Substituting k = n, we get

T(n) = T(0) + 1 + 2+….. +n = n(n+1)/2 = O(n^2)

Different types of recurrence relations and their solutions

In this article, we will see how we can solve different types of recurrence relations using different approaches. Before understanding this article, you should have idea about recurrence relations and different method to solve them (See : Worst, Average and Best Cases, Asymptotic Notations, Analysis of Loops).

Similar Reads

Type 1: Divide and Conquer Recurrence Relations:

Following are some of the examples of recurrence relations based on divide and conquer....

Type 2: Linear Recurrence Relations:

Following are some of the examples of recurrence relations based on linear recurrence relation....

Type 3: Value Substitution Before Solving:

Sometimes, recurrence relations can’t be directly solved using techniques like substitution, recurrence tree or master method. Therefore, we need to convert the recurrence relation into appropriate form before solving. For example,...

Practice Problems on Recurrence Relations:

Question 1: What is the time complexity of Tower of Hanoi problem?...