Grokking Algorithm Complexity and Big-O
Ask Author
Back to course home

0% completed

Vote For New Content
Recurrence Relation Method
On this page

The Recurrence Relation Method allows us to express the time complexity of a recursive algorithm as a mathematical equation, or recurrence relation, based on the size of the input.

Recurrence relations are equations that express the time complexity of a recursive function in terms of the function itself. This method is useful for algorithms where each recursive call breaks the problem down into smaller subproblems until a base case is reached.

Example: Factorial Function

Let’s analyze the time complexity of a recursive function that calculates the factorial of a number, n!

.....

.....

.....

Like the course? Get enrolled and start learning!

On this page