Skip to content

Glossary: Coding Interviews in Go

Monotonic stack

A stack kept in strictly increasing or decreasing order by removing items that break the order as new ones arrive. It is used to answer 'next bigger value' questions in O(n) time.

Where the book teaches it

Related terms

Stack