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.
Which of the following is NOT an autobiography of a sportsperson?
India is a member of which of the following organizations?
Under which of the following campaigns did Rajnath Singh virtually inaugurate more than 57,000 water
structures in Madhya Pradesh in February 2021?
In which district of Uttar Pradesh is Chandra Prabha wildlife sanctuary located?
Which of the following banks have merged with Bharat Financial Inclusion in which the shares of the latter will be transferred to the bank?
Which country is currently leading the research in commercializing Quantum Key Distribution (QKD) for secure communications?
The Monetary Policy Committee (MPC) at its meeting in December 7, 202 decided to increase the Bank Rate to how much Basis point/percent?
Who is the author of the novel “I Shall Not Hear the Nightingale”?
Which of the following states of India will host the 2023 Men's Hockey World Cup?
According to the sample registration system, which of the following states has the highest infant mortality rate (for 2019)?