Question:

What is the data structure used for converting a recursive program into the non-recursive version of the same?

Show Hint

The stack data structure is essential for managing function calls in recursive algorithms.
Updated On: May 3, 2025
  • Stack
  • Queue
  • Tree
  • Graph
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

A stack is used for storing the function calls and local variables during recursion. By simulating the recursive calls using a stack, we can convert a recursive program into an iterative one. This is done by using the stack to manage the execution flow and keeping track of the intermediate results.
Thus, the correct answer is \( \text{Stack} \).
Was this answer helpful?
0
0

Top Questions on Data Structures

View More Questions