NOTE
Stack
LIFO storage, push/pop/peek operations, recursion, parsing, monotonic stacks, and implementation choices.
This is a historical learning note and may contain outdated or incomplete understanding.
A stack is last-in-first-out: push adds to the top, pop removes the top, peek observes it.
Stacks appear in call/recursion management, expression parsing, DFS, undo, bracket matching, and monotonic-stack algorithms.
An array/deque is often a practical implementation; linked nodes are another option. The abstract behavior matters more than the concrete container.