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
How do you do dynamic memory allocation in C applications?
What is typedf?
How many data structures are there in c?
What is wrong with this statement? Myname = 'robin';
What is the difference between class and object in c?
What is fflush() function?
What is the use of header?
What are types of preprocessor in c?
Can main () be called recursively?
explain what are actual arguments?
Why functions are used in c?
Is swift based on c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What is call by value in c?
How can I determine whether a machines byte order is big-endian or little-endian?