Sections


Main-Menu

header image

Recursion


Recursion

An algorithmic technique where a function, in order to accomplish a task, calls itself with some part of the task. Recursion is one of the most powerful tools in a programming language, but one of the most threatening things to do as there is sometimes uncertainty about the conditions and specifications required to be known to use recursion successfully.

There are two types of recursion:

1.    Direct recursion.
2.    Indirect recursion.

Example of Direct Recursion

int abc ()
{
—;
abc ();
}

Example of Indirect Recursion

int abc ()
{
—;
—;
xyz ();
}
int xyz ()
{
abc ();
—;
}


Related Articles :



Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Shaadi.com Matrimony - Register for FREE