what are the advantage and disadvantage of recursion

Answer Posted / satyabrata nayak

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 ?    23 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the explanation for cyclic nature of data types in c?

914


Compare interpreters and compilers.

856


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

931


What does the format %10.2 mean when included in a printf statement?

1389


How does sizeof know array size?

872


What is meant by type casting?

852


Write a program for finding factorial of a number.

870


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1955


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

872


Explain how can you determine the size of an allocated portion of memory?

861


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

2878


explain what is an endless loop?

860


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1903


What is pre-emptive data structure and explain it with example?

3510


What is structure data type in c?

786