Recursion

Definition
Recursion in the computer sciences in the concept of defining a function or class which references itself in its definition. In a more general sense, recursion is the concept of referencing an algorithm from within that algorithm itself. Recursion differs from conditional loops in the sense that a recursive definition iterates through its process up to the point at which the recursion is defined each time, and then returns backwards down the stack from the innermost iteration to the original call (completing the algorithm after each return and then returning to the next level). Conditional loops (for statements for instance), however, do not necessarily reference themselves.

Example
if (n < 0) {   res = -1; // Return an error } if (n == 0) {   res = 1; }   else {   res = n * fact(n - 1); } return( res );
 * 1) define fact(n)