Question:

What type of data structure is used in recursion?

Show Hint

If a recursive algorithm runs too deep (too many nested calls), it can lead to a stack overflow error. This happens when the call stack runs out of memory to store the activation records.
Updated On: Jul 2, 2026
  • Stack
  • Queue
  • Tree
  • Linked List
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Recursion is a programming technique where a function calls itself.
To manage these nested function calls, the system uses a call stack.
When a function is called, an activation record (or stack frame) is created and pushed onto the call stack. This record contains information about the function call, such as its parameters, local variables, and the return address (where execution should resume after the function finishes).
In a recursive function, each time the function calls itself, a new activation record is pushed onto the stack.
When a recursive call returns, its activation record is popped off the stack, and execution resumes at the point specified by the return address in the new top-of-stack record.
This LIFO (Last In, First Out) behavior is perfectly managed by a stack data structure. Therefore, a stack is the underlying data structure used to implement recursion.
Was this answer helpful?
0
0