What are advantages and disadvantages of recursive
calling ?

Answer Posted / anonymous

Advantage :

Recursion is used to divide the problem into same problem
of subtypes and hence replaces complex nesting code.

Disadvantage :

Recursion takes a lot of stack space, usually not
considerable when the program is small and running on a PC.

It is very hard to debug or extend the functionality in
case of recursive logic.

Is This Answer Correct ?    66 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of c preprocessor?

699


Difference between exit() and _exit() function?

645


What is the benefit of using an enum rather than a #define constant?

643


number of times a digit is present in a number

1533


What are structure members?

586






in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

581


What is the difference between declaring a variable and defining a variable?

710


How do you do dynamic memory allocation in C applications?

619


What is && in c programming?

665


Can we change the value of static variable in c?

550


Write program to remove duplicate in an array?

589


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1184


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

796


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2702


How can a process change an environment variable in its caller?

645