Monotonic stack
A monotonic stack is a stack whose elements are monotonically increasing or decreasing.
Definition of monotonically increasing:
monotonic increasing (not comparable) (mathematics, of a function) always increasing or remaining constant, and never decreasing; contrast this with strictly increasing.
Applications of Monotonic stack
- Finding next greater/smaller element