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

in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

608


Explain about the constants which help in debugging?

858


What should malloc(0) do?

619


What does main () mean in c?

618


How do you use a pointer to a function?

638






What is c language & why it is used?

587


What is the difference between text and binary modes?

650


How do you declare a variable that will hold string values?

672


How can you return multiple values from a function?

638


How can I do serial ("comm") port I/O?

694


What functions are used in dynamic memory allocation in c?

599


what is the difference between class and unio?

1866


Do you know the use of fflush() function?

605


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

656


Why isnt there a numbered, multi-level break statement to break out

592