Trace some operations on an empty stack: Push : stack is
Push : stack is
Push : stack is
Pop: returns , stack is
Peek: returns , stack stays
Pop: returns , stack is
The rightmost element is the "top." The last element you added is the first one you remove.