Monotonic Stack Visualizer

Watch a monotonic stack find the next greater element and the largest rectangle in a histogram, one push and pop at a time.

More in CS Labs & Coding.