Question

A stack is initially empty, then the following commands are performed.
push 5
push 7
pop
push 10
push 5
pop
Which of the following is the correct stack (assume the top of the stack is on the left).
(a) 5 10 7 5
(b) 5 10
(c) 7 5
(d) 10 5

Answer

This answer is hidden. It contains 3 characters.