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


Please Help Members By Posting Answers For Below Questions

What are structures and unions? State differencves between them.

586


What is a string?

633


Write a code to determine the total number of stops an elevator would take to serve N number of people.

704


What is the use of f in c?

536


What are different storage class specifiers in c?

588






How can I list all of the predefined identifiers?

553


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(); }

1834


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..

1566


What does it mean when the linker says that _end is undefined?

599


What are the loops in c?

570


What functions are used for dynamic memory allocation in c language?

574


Is printf a keyword?

730


int far *near * p; means

3093


What does 4d mean in c?

902


What are the characteristics of arrays in c?

591