Data structures use to carry out recursion

What is the data structures employed to carry out recursion?

E

Expert

Verified

Stack. Due to its LIFO (Last in First Out) property it remembers its 'caller' so knows whom to return when the function has to return. Recursion makes employ of system stack for storing return addresses of function calls.

Every recursive function has its equal iterative (non-recursive) function. Even when these equal iterative processes are written, explicit stack is to be employed.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.