Tuesday, January 20, 2009

LEARNINGS OF THE WEEK (M.N. SISON)

We have discussed about programming:RECURSION
this is how we defined Recursion...

RECURSION


  • It is the repetitive process by which a functions calls itself is called recursion or circular definition. This is a way of defining something in terms of itself. A function is said to be recursive if a statement in the body of the function calls the function that contains it.
PARTS OF RECURSION:

Base Case

- This is the part of the recursive function that is found on the if clause. This contains the condition that should be satisfied at one point of execution to terminate the repetitive process done by the recursive function.


General Case

-This is the part of the recursive function that is found on the else-clause. This contains the function call of the recursive function to itself.

KINDS OF RECURSION:
Direct Recursions are recursive functions that can call itself through a function call directly inside the body of the function. v Indirect recursions are recursive functions that can call another functions outside its function.




No comments: