25. What data structure would you mostly likely see in non recursive implementation of a recursive algorithm?

a) Linked List
b) Stack
c) Queue
d) Tree

Answer: b
Explanation: In recursive algorithms, the order in which the recursive process comes back is the reverse of the order in which it goes forward during execution. The compiler uses the stack data structure to implement recursion. In the forwarding phase, the values of local variables, parameters and the return address are pushed into the stack at each recursion level. In the backing-out phase, the stacked address is popped and used to execute the rest of the code.

Leave a Reply

Your email address will not be published.