Open In App

What is Recursion?

Recursion is defined as a process which calls itself directly or indirectly and the corresponding function is called a recursive function.

Properties of Recursion:

Recursion has some important properties. Some of which are mentioned below:



Types of Recursion:

  1. Direct recursion: When a function is called within itself directly it is called direct recursion. This can be further categorised into four types: 
    • Tail recursion,  
    • Head recursion,  
    • Tree recursion and 
    • Nested recursion.
  2. Indirect recursion: Indirect recursion occurs when a function calls another function that eventually calls the original function and it forms a cycle.

To learn more about types of recursion, refer to this article.

Applications of Recursion:

Recursion is used in many fields of computer science and mathematics, which includes:



Advantages of Recursion:

Disadvantages of Recursion:

What else can you read?

Article Tags :