Which data structure is used to perform recursion?

Which data structure is used to perform recursion?

Implementing recursive function does specifically doesn’t rely on any particular data structure from the programmer’s end but internally recursion is managed in a call stack of a program which is an implementation of stack data structure.

Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls.

Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.