Mental Model
A stack stores items in order, last in first out. You can build it using a linked list or an array, each with its own strengths and weaknesses.
Analogy: Imagine a stack of plates. Using an array is like a fixed shelf where plates are stacked in order, but the shelf size is fixed or needs resizing. Using a linked list is like stacking plates on a flexible pole where you can add or remove plates easily without worrying about shelf size.
Array Stack: [0] 1 [1] 2 [2] 3 ↑top Linked List Stack: 3 -> 2 -> 1 -> null ↑top
