What is the data structures used to perform recursion?

Go down

What is the data structures used to perform recursion?

Post  Admin on Sun Jan 31, 2010 7:16 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.

Admin
Admin

Posts : 71
Join date : 2010-01-21

View user profile http://campus-interview.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum