Mental Model
A stack is a collection where you add and remove items from the top only. When the stack gets full, we make the storage bigger automatically to hold more items.
Analogy: Imagine a stack of plates. You can only add or remove the top plate. If the stack gets too tall for the shelf, you get a bigger shelf to hold more plates.
Stack array: [ 1, 2, 3, null, null ] Top index: ↑ 2 (points to 3) Capacity: 5 null means empty space ready to hold new items.
