A recursive function is a function that calls on itself. A recursive function must contain a decision structure that divides the code into two cases. The code must guarantee that eventually the nonrecursive case is called. The code may be much easier to write.
Some situations are naturally recursive.
Disadvantages of Recursion Recursive functions are generally slower than nonrecursive functions. Excessive recursion may overflow the system stack. One must be very careful when writing recursive functions. Naturally Recursive Data Structures Linked lists.