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

sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2; Find the value of x?

4 Answers   Subex,


write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.

6 Answers  


What is the use of typedef in structure in c?

0 Answers  


find largest element in array w/o using sorting techniques.

3 Answers   Zycus Infotech,


What is FIFO?

0 Answers  






Explain bit masking in c?

0 Answers  


write a program that explain #define and # undef directive

1 Answers  


What is structure in c language?

0 Answers  


What are different types of pointers?

0 Answers  


write a program for 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 4 4

1 Answers  


write a 'c' program to sum the number of integer values

8 Answers  


What is meaning of tree

0 Answers  


Categories