A stack that also returns its minimum in O(1): keep a second stack of minimums beside it, and push onto it only when a value is at most the current minimum. Against scanning the stack, n − 1 comparisons for every min.
This interactive visualization needs JavaScript.