English

Assertion: Recursion utilises more memory as compared to iteration. Reason: Time complexity of recursion is higher due to the overhead of maintaining the function call stack. - Computer Science (Theory)

Advertisements
Advertisements

Question

Assertion: Recursion utilises more memory as compared to iteration.

Reason: Time complexity of recursion is higher due to the overhead of maintaining the function call stack.

Options

  • Both Assertion and Reason are true and Reason is the correct explanation for Assertion.

  • Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.

  • Assertion is true and Reason is false.

  • Assertion is false and Reason is true.

MCQ

Solution

Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.

Explanation:

  • Assertion: The assertion is correct since recursion often requires extra memory due to the function call stack.
  • Reason: The reason is also true, but it is not an accurate explanation for the assertion because the greater memory usage in recursion is mostly due to the call stack rather than the time complexity.
shaalaa.com
Recursion
  Is there an error in this question or solution?
2024-2025 (April) Specimen Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×