So far, we have seen some example cases of recursion and how it is being used. Though the term says recursion, there are different types of recursions. We will explore them one by one.
Different types of recursions
Linear recursion
One of the most commonly used recursions in the programming world is linear recursion. When a function calls itself once in each run, we will call it a linear recursion. Just like our factorial example, when we are breaking the big calculation to smaller ones until the base condition is reached, we call it winding. When we are returning from the base condition to the first recursive call, we call it unwinding. We will work on different linear recursions in the upcoming section in this chapter.
...