Recursion and Base condition

Recursion and Base condition

by Arafat Islam -
Number of replies: 0

Recursion:

A Function calling itself again and again directly or indirectly is called Recursion, and the function which it calls is called a recursive function, it is used in divide and conquer algorithms/techniques.

Base condition:

The base condition (or base case) defines when the recursion should stop. Without a base case, a recursive function would continue calling itself indefinitely, resulting in a stack overflow.