A stack whose values stay in order. Each new value pops what it breaks the order with, and every pop answers a question: the next greater value, or the largest rectangle.
This interactive visualization needs JavaScript.