Wednesday, November 23, 2011

Recursion

Recursion is a process by which a function calls itself repeatedly until some specified condition has been satisfied.
A function is called recursive if a statement within in the body of a function calls the same function.When a recursive program is executed, the recursive function calls are not executed immediately.

Advantages of recursive function
1. Used to create clearer and simpler versions of several algorithams
2. Memory occupied when the recursive function is called is very less
3. Very useful way of creating and accessing certain dynamic data structures such as linked lists, stacks, queues,etc.

No comments:

Post a Comment