A stack is kind of like a pile of dishes:
When you put one on, that will be the first taken off:
As you can see, the third is on top.Code:3rd put on. 2nd put on. 1st put on.
Code:Push something onto stack: 4th put on. 3rd put on. 2nd put on. 1st put on.Code:Pop something off the stack: stack: Value returned: 3rd put on. 4th put on. 2nd put on. 1st put on.




Reply With Quote