103k views
5 votes
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 after those commands (assume the top of the stack is on the left)? A. 5, 10, 7, 5.

B. 5, 10.
C. 7, 5.
D. 10, 5.

1 Answer

2 votes

Answer:

D. 10, 5.

Step-by-step explanation:

A stack is initially empty, then the following commands are performed: push 5, push-example-1
User AdriSolid
by
5.1k points