long story short my lecturer is crap, and was showing us infix to prefix stacks via an overhead projector and his bigass shadow was blocking everything so i missed the importan
Hopefully this will help you visualize a Stack, and how it works.
Empty Stack:
| |
| |
| |
-------
After Pushing A
, you get:
| |
| |
| A |
-------
After Pushing B
, you get:
| |
| B |
| A |
-------
After Popping, you get:
| |
| |
| A |
-------
After Pushing C
, you get:
| |
| C |
| A |
-------
After Popping, you get:
| |
| |
| A |
-------
After Popping, you get:
| |
| |
| |
-------