Glossary: Coding Interviews in Java
Monotonic stack
A stack kept in increasing (or decreasing) order, used for "next bigger value" questions. Each new item pops the entries that break the order before it is pushed.
Glossary: Coding Interviews in Java
A stack kept in increasing (or decreasing) order, used for "next bigger value" questions. Each new item pops the entries that break the order before it is pushed.