Start learning 50% faster. Sign in now
Recursion involves a function calling itself until a base condition is met. Each recursive call creates a new stack frame, leading to memory usage that grows with the depth of recursion. Iteration, on the other hand, uses loops and does not involve stack frame creation, making it more memory-efficient in many cases. Why Other Options Are Incorrect: 1. Recursion uses loops for repetition, whereas iteration does not: This statement reverses the roles. Recursion relies on function calls for repetition, while iteration explicitly uses loops (for, while). 2. Iteration cannot solve problems that recursion can solve: Iteration can replicate recursion's functionality by using stacks or queues explicitly. Recursion is often a stylistic or practical choice, not a limitation of iteration. 3. Recursion is always faster than iteration: Recursion can sometimes be slower due to stack overhead and repeated function calls. Tail-call optimization can mitigate this in some languages, but generally, iteration is faster for equivalent tasks. 4. Recursion does not require a base case, while iteration requires a condition: Recursion must have a base case to terminate; otherwise, it leads to infinite calls. Iteration, too, requires a stopping condition, such as a loop exit condition.
What should come in place of the question mark (?) in the given series based on the English alphabetical order?
TUO, VWR, XYU, ZAX, ?
In a certain code language ‘COMPUTE’ is written as ‘NPDPFUV’ and ‘PLAYERS’ is written as ‘BMQYTSF’. How is ‘FURIOUS’ written in that...
If the first letter from the left side of the word is removed, then how many words contain at least two consonants?
Which two numbers should be interchanged to make the following equation correct?
108 ÷ 5 − 2 × 9 + 25 = 27
Read the given statements and conclusions carefully. Assuming that the information given in the statements is true, even if it appears to be at varianc...
Which of the following friends, like Purple ?
In a certain code REASONING is written as TBFSNFMHM. How is INSURANCE written in that code?
Find which one of the given words can be made from the letters of the given word.
‘ MOBILIZE ’
...In the word ‘IMPORTANT’ all consonants are written as their preceding letter and all vowels are written as their following letters. Now all letters...
Out of the four given equations, the first three are solved based on a certain system. Find the correct answer for the unsolved fourth equation on the ...