What are advantages and disadvantages of recursive
calling ?
Answer Posted / ganesh narayanan
advantage : A recursive definition defines an object in simpler cases of itself reducing nested looping complexity
disadvantage : less efficient as compared to the non-recursive counterparts as the overhead involved in entering,re-entering and exiting a block is avoided in case of the non recursive forms. its also possible to identify a number of local variables which need not be saved and restored with the help of stacks and this unwanted stacking activity is avoided in the non-recursive versions.
Is This Answer Correct ? | 26 Yes | 7 No |
Post New Answer View All Answers
What are structures and unions? State differencves between them.
What is a string?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What is the use of f in c?
What are different storage class specifiers in c?
How can I list all of the predefined identifiers?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What does it mean when the linker says that _end is undefined?
What are the loops in c?
What functions are used for dynamic memory allocation in c language?
Is printf a keyword?
int far *near * p; means
What does 4d mean in c?
What are the characteristics of arrays in c?