which is faster execution: loops or recursion?
Answers were Sorted based on User's Feedback
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 |
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 |
Write a code to generate divisors of an integer?
What is the meaning of typedef struct in c?
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?
how to capitalise first letter of each word in a given string?
What is function prototype?
Explain how can you restore a redirected standard stream?
What is FIFO?
Difference between constant pointer and pointer to a constant.
Example of friendly function in c++
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
Write a c program to demonstrate character and string constants?
What is volatile, register definition in C