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.
Leprosy, also known as Hansen’s disease, is a chronic disease caused by ?
How many women will be selected for the EmpowHER Biz initiative under the WEP of NITI Aayog?
In the book "Si-Yu-Ki" written by theChinese Buddhist traveler and monk Fa-hein during his visit to India, which king's kingdom is described in detail, ...
Which of the following methods can be used to control excess demand in the economy?
Consider the following statements regarding ‘GIFT NIFTY’:
Statement-I: GIFT NIFTY is the first of its kind trading link, with trading and...
The Madhya Pradesh government approved a proposal to increase the Minimum Support Price (MSP) for soya bean from ₹4,000 to what amount per quintal?
Nayab Saini has been appointed as the new Chief Minister (CM) of which Indian state? ?
Who inaugurated the One Earth One Health – Advantage Healthcare India – 2023 conference in New Delhi?
Which of the following is not matched correctly in regards to Padma Bhushan Awards?
When was the new export policy of Uttarakhand implemented?