Start learning 50% faster. Sign in now
Get Started with ixamBee
Start learning 50% faster. Sign in nowRecursion 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.
Who has been elected as the new President of Singapore?
Consider the following statements about Tax Inspectors Without Borders (TIWB) programme:
1. Recently, India has been chosen as the Pa...
Consider the following statements:
I. To enhance the future career prospects of Agniveers and equip them for various job roles in the civilian...
On 23rd December, 2022, Kaikala Satyanarayana passed away at the age of 87 years at his residence due to some illness, he was related to which of the fo...
Wind industry Windergy 2023 going to be held at which place?
What is the initial investment for India’s first AI-focused Datacentre Park inaugurated in Raipur, Chhattisgarh?
In operating systems, what does the "Working Set Model" primarily deal with?
Which flagship skilling initiatives did India highlight during the BRICS meeting?
Who has won the Men’s Ballon d’Or Award for the year 2021?
Bar is a unit of which one of the following?