Site icon DocMCQs

What data structure would you mostly likely see in non recursive implementation of a recursive algorithm?

a) Stack
b) Linked List
c) Tree
d) Queue

A stack is the data structure most likely seen in a non-recursive implementation of a recursive algorithm.

Why a Stack?

How it works:

By using a stack, you can effectively transform a recursive algorithm into an iterative one, often improving performance and memory efficiency.

Exit mobile version