The following sequence of operations is performed one a stack:
PUSH(10), PUSH(20).POP, PUSH(10), PUSH(20), POP, POP, POP PUSH(20), POP
The sequence of values popped out is
Stack:-
A stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed.
PUSH(10), PUSH(20).POP, PUSH(10), PUSH(20), POP, POP, POP PUSH(20), POP The sequence of values popped out is 20, 20, 10, 10, 20.