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 difference between Structure and Unions?
What are c preprocessors?
Where static variables are stored in c?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Is linux written in c?
What is nested structure in c?
Which type of language is c?
How do I create a directory? How do I remove a directory (and its contents)?
Write a C program in Fibonacci series.
Write program to remove duplicate in an array?
What is array of structure in c?
How many types of operator or there in c?
Without Computer networks, Computers will be half the use. Comment.
Why is c fast?
Define circular linked list.