What are advantages and disadvantages of recursive
calling ?
Answer Posted / sachin mahajan
Advantages:
Through Recursion one can Solve problems in easy way while
its iterative solution is very big and complex.
Ex : tower of Hanoi
You reduce size of the code when you use recursive call.
Disadvantages :
Recursive solution is always logical and it is very
difficult to trace.(debug and understand)
Before each recursive calls current values of the varibles
in the function is stored in the PCB, ie process control
block and this PCB is pushed in the OS Stack.
So sometimes alot of free memory is require for recursive
solutions.
Remember : whatever could be done through recursion could be
done through iterative way but reverse is not true.
| Is This Answer Correct ? | 103 Yes | 30 No |
Post New Answer View All Answers
What is define directive?
Explain the use of 'auto' keyword
What is the easiest sorting method to use?
Why doesnt the call scanf work?
how can f be used for both float and double arguments in printf? Are not they different types?
Do you know the difference between malloc() and calloc() function?
What does s c mean on snapchat?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
How to throw some light on the b tree?
How many parameters should a function have?
How can I run c program?
What is #include cctype?
Explain about block scope in c?
Explain the difference between malloc() and calloc() function?
What does & mean in scanf?