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

What is the purpose of 'register' keyword?

0 Answers  


I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?

2 Answers  


Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }

3 Answers   NDS,


How will you divide two numbers in a MACRO?

0 Answers   Apps Associates,


What is the hardest programming language?

0 Answers  






What is the Difference between Macro and ordinary definition?

3 Answers   Bosch, Cognizant, College School Exams Tests, Motorola,


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

0 Answers  


how to write palindrome program?

3 Answers  


Explain what’s a signal? Explain what do I use signals for?

0 Answers  


What are structures and unions? State differencves between them.

0 Answers   iNautix,


What is a wrapper function in c?

0 Answers  


write a c program to calculate the income tax of the employees in an organization where the conditions are given as. (I.T. = 0 if income <100000 I.T = 10% if income _< 200000 it = 20% if income >_ 200000)

7 Answers   Consultancy, DBU, FD, JK Associates, Kobe, Satyam,


Categories