Stack Operations – 2 :: Discussion


3.What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm ?
A.Linked List
B.Stack
C.Queue
D.Tree
Answer:  Option  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.

Tutorial Link:
Published by:

Comments are not available


Quick Links

GAT Subject



   Computer Science    English    Agriculture    Botany    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC    PPSC    NTS