In general there are two types of Functions/Procedures or Algorithms
a. Non Recursive
b. Recursive
For recursive algorithms following is required:
i. Recursive Definition
ii. Termination Condition which controls the recursive calls
Learn how to obtain recursive definition and termination condition easily.
Example how to write recursive algorithm for
1. Factorial of a given number
2. Sum of all array elements.