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
Why isnt any of this standardized in c?
What is the full form of getch?
What is the ANSI C Standard?
How do you define a function?
What is the difference between memcpy and memmove?
Can a pointer be static?
regarding pointers concept
What are the types of data structures in c?
hi any body pls give me company name interview conduct "c" language only
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
Explain output of printf("Hello World"-'A'+'B'); ?
How can I find the modification date of a file?
Write a program to reverse a given number in c?
How can I sort a linked list?
Write a code on reverse string and its complexity.