which is faster execution: loops or recursion?




Answers were Sorted based on User's Feedback



which is faster execution: loops or recursion?..

Answer / saran3589

loops

Is This Answer Correct ?    16 Yes 2 No

which is faster execution: loops or recursion?..

Answer / nipa

loop is faster then recursion. because in recursion several
time function call itself, so it take time to pass control
to function and return value, but in loop control not pass
in other function it work in same function.here we consider
that function and loop contain same number of statement.

Is This Answer Correct ?    4 Yes 0 No

which is faster execution: loops or recursion?..

Answer / sight

It's not necessary that every time faster loops only because
it's depends upon the problem.....
On this we take decision that it's faster working with loop
or recursion....

Is This Answer Correct ?    6 Yes 4 No



Post New Answer



More C Interview Questions

How would you find a cycle in a linked list?

3 Answers   NSN,


Output for following program using for loop only * * * * * * * * * * * * * * *

3 Answers  


write a C code To reverse a linked list

2 Answers   Wipro, Motorola,


write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...

1 Answers   Philips,


#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

6 Answers   ME,






enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

4 Answers   ME,


i want to make a program in which we use input having four digits(4321) and get output its reciprocal(1234).

1 Answers  


what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means....

1 Answers   TCS,


How do we make a global variable accessible across files? Explain the extern keyword?

0 Answers  


what are the compilation steps? ( i want inside the compiler )

2 Answers  


What is the output of the program #include<stdio.h> #include<conio.h> void main() {0 int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); }

4 Answers   CTS, Oracle,


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

0 Answers  






Categories