Types of Recursion
There are several different recursion types and terms. These include:
- Direct recursion: This is typified by the factorial implementation where the methods call itself.
- In-Direct recursion: This happens where one method, say method A, calls another method B, which then calls method A. This involves two or more methods that eventually create a circular call sequence.
- Head recursion: The recursive call is made at the beginning of the method.
- Tail recursion: The recursive call is the last statement.
Recursion Algorithms
Recursion is technique used in computer science to solve big problems by breaking them into smaller, similar problems. The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function. Using a recursive algorithm, certain problems can be solved quite easily.
Contact Us