-Recursion is the technique of making a function call itself -Basically, one method is invoking itself -Infinite recursion – method never stops calling itself
-A recursive program has greater space requirements than an iterative program as each function call will remain in the stack until the base case is reached. -It also has greater time requirements because each time the function is called, the stack grows and the final answer is returned when the stack is popped completely.
-For a recursive function, you only need to define the base case and recursive case, so the code is simpler and shorter than an iterative code. -Some problems are inherently recursive, and we need to implement recursion.
-A function is said to be recursively defined if the function refers to itself such that
- There are certain arguments, called base values, for which the function does not refer to itself.
- Each time the function does refer to itself, the argument of the function must be closer to a base value.
For every recursive algorithm, there is an equivalent iterative algorithm. -However, iterative algorithms are usually more efficient in their use of space and time.