Home > DeveloperSection > Interviews > What is the data structures used to perform recursion?

Posted on    September-22-2014 2:08 AM

 C# C# 
 1 Answer(s)
  669  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Posted on    September-22-2014 2:08 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick