A monotonic stack is an extension of the Stack data structure in which the elements of the stack are in either increasing or decreasing order. The stack in which the items are in increasing order is called the monotonically increasing stack, the top element of such a stack will be the largest of all the elements below. On the other hand, if the items are arranged in a decreasing order then the stack is called a monotonically decreasing stack, on which the top element will be the smallest of all the elements below. Monotonic stacks are very popular in competitive programming.
A blog discussing solutions to programming problems using a variety of programming languages.