which is faster execution: loops or recursion?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between scanf and gets?

615


#include { printf("Hello"); } how compile time affects when we add additional header file .

1424


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3734


Is null always equal to 0(zero)?

587


Why do we use return in c?

570






What does p mean in physics?

586


What is the code in while loop that returns the output of given code?

1320


C language questions for civil engineering

1245


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

784


What’s the special use of UNIONS?

659


What is the difference between ‘g’ and “g” in C?

2575


What does void main return?

607


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1666


Function calling procedures? and their differences? Why should one go for Call by Reference?

635


What are type modifiers in c?

624