What are advantages and disadvantages of recursive
calling ?

Answer Posted / swapna

advantages ;
recursive functions can be effectively used to solve
problems where the solution is expressed in terms of
applying the same solution.
disadvantages ;
in recursive we must have an if statement somewhere to
force the func. to return without the recursive call being
executed.otherwise the funct. will never return.

Is This Answer Correct ?    22 Yes 36 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the Purpose of 'extern' keyword in a function declaration?

635


What is structure in c explain with example?

620


What is the equivalent code of the following statement in WHILE LOOP format?

752


What is the stack in c?

707


When we use void main and int main?

575






Explain is it valid to address one element beyond the end of an array?

717


What is typedef?

655


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1915


Explain indirection?

631


How is = symbol different from == symbol in c programming?

596


Why cant I open a file by its explicit path?

585


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

663


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1509


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2195


regarding pointers concept

1559