What is the data structures used to perform recursion?

Answer Posted / phool chand

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.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between data type and data structure?

413


Explain how to find 3rd element from end in a linked list in one pass?

486


What does arraylist remove return?

454


Is hashmap get thread safe?

478


What is a vector class?

487






Define an equivalence relation?

644


What is linked hash set?

471


In what scenario, binary search can be used?

560


Which is better hashmap or treemap?

498


What is the difference between hashmap and arraylist?

519


What are common data structures?

588


Is it legal to initialize list like this?

550


Is hashmap an object?

497


How many types of data structure are there?

456


What type of algorithm is binary search?

467