0
6.2kviews
What is recursion? State its advantages and disadvantages.

Mumbai University > Information Technology > Sem 3 > Data structure and algorithm analysis

Marks: 3M

Year: May 2016

1 Answer
0
827views

RECURSION - A method of programming whereby a function directly or indirectly calls itself. Recursion is often presented as an alternative to iteration. Recursion is simply the use of a function which, as part of it's own execution code, invokes itself.

Advantage:

Recursion will be useful when same kind of job has to be continued for a finite no input or time. Eg: calculating series, finding factorial etc.

It reduces unnecessary calling of function.

Disadvantage:

A recursive program has a stack overhead.

Recursion uses more processor time.

Please log in to add an answer.