Which of the following data structures is used to perform recursion?
-
Queue
-
Stack
-
Tree
-
Linked list
B
Correct answer
Explanation
Stack is used to perform recursion. It stores the function call in stack. then call each function in LIFO order. Let a function is called from its own body then for to track the function call, each call is pushed into stack till the end of counter then one by one each function call is executed. So, stack is a correct answer.