Question:

Which data structure is used in recursive function implementation?

Show Hint

Every recursive call creates an activation record that is pushed onto the Call Stack. Recursion and Stack are closely related concepts in programming.
Updated On: Jun 25, 2026
  • Stack
  • Queue
  • Tree
  • Graph
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept: Recursion is a programming technique in which a function calls itself either directly or indirectly. Whenever a recursive function is called, the system must store information about the current function call so that execution can resume correctly after the recursive call returns. This information is stored in a special memory area called the Call Stack. The stack follows the principle: \[ \text{LIFO (Last In First Out)} \] which perfectly matches the behavior of recursive function calls.

Step 1:
Understand recursion.
Consider the recursive factorial function: \[ fact(n)=n\times fact(n-1) \] For example, \[ fact(4) \] calls \[ fact(3) \] which calls \[ fact(2) \] which calls \[ fact(1). \]

Step 2:
Observe how function calls are stored.
Before calling another function, the current function's:
• Return address
• Local variables
• Parameters are stored in memory. These records are pushed onto a stack.

Step 3:
Understand returning from recursion.
When the deepest recursive call finishes, function calls return in reverse order. This follows the LIFO principle: \[ fact(1)\rightarrow fact(2)\rightarrow fact(3)\rightarrow fact(4) \] which is exactly the behavior of a stack.

Step 4:
Choose the correct answer.
Therefore, recursive function implementation uses a \[ \boxed{\text{Stack}} \] Hence option (A) is correct.
Was this answer helpful?
0
0