Mental Model
A stack is like a pile where you add and remove items only from the top. Using an array, we keep track of the top position to add or remove elements.
Analogy: Imagine a stack of plates: you can only put a new plate on top or take the top plate off. The array holds the plates in order, and a pointer shows which plate is on top.
Array: [ _ , _ , _ , _ , _ ]
Top index: -1 (empty stack)
Visual:
Bottom -> [ _ , _ , _ , _ , _ ] <- Top
↑ top = -1 (no plates)