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
What are the advantages of c preprocessor?
Difference between exit() and _exit() function?
What is the benefit of using an enum rather than a #define constant?
number of times a digit is present in a number
What are structure members?
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
What is the difference between declaring a variable and defining a variable?
How do you do dynamic memory allocation in C applications?
What is && in c programming?
Can we change the value of static variable in c?
Write program to remove duplicate in an array?
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.
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 ?
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;i
How can a process change an environment variable in its caller?