Show the worked solutionTrace the stack (bottom to top):\[\text{push 1: }[1],\ \text{push 2: }[1,2],\ \text{pop: }[1],\ \text{push 3: }[1,3],\ \text{push 4: }[1,3,4],\]\[\text{pop: }[1,3],\ \text{pop: }[1],\ \text{push 5: }[1,5],\ \text{pop: }[1].\]The top of the stack is 1.Answer: D
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com