1Suppose you have an empty generic stack. What does the stack look like after the following operations have been performed? Be sure to indicate the top of the stack.
Push 4
Push 9
Push 1
Push 9
Pop
Push 8
Pop
Pop
Push 3
Stack pointer stack
SP bottom
| |
Push 4 4 | |
Push 9 9 4 | |
Push 1 1 9 4 | |
Push 9 9 1 9 4 | |
Pop 1 9 4 | |
Push 8 8 1 9 4 | |
Pop 1 9 4 | |
Pop 9 4 | |
Push 3 3 9 4 |
Comments
Leave a comment