what are the advantage and disadvantage of recursion

Answer Posted / vadivelt

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..

Disadvantage would be,
1.Hard to analyse or understand the code.
2.If the recursive function is called for infinite no of
times and memory constrains are not taken care, then stack
overflow may occur So system may crash.

Is This Answer Correct ?    52 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In a header file whether functions are declared or defined?

896


Explain about the functions strcat() and strcmp()?

797


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

810


Explain what is the benefit of using #define to declare a constant?

818


What is c method?

754


What is c basic?

904


Can you please explain the difference between malloc() and calloc() function?

873


Difference between Function to pointer and pointer to function

846


What is a class c rental property?

864


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

975


Write a program to swap two numbers without using third variable?

1061


Can a program have two main functions?

861


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4853


Why is c known as a mother language?

977


what is the structure pointer?

1865