Concepts2
🗂️Data StructureIntermediate
Stack
A stack is a Last-In, First-Out (LIFO) data structure where push, pop, and top operations run in O(1) time.
#stack#lifo#push+12
🗂️Data StructureIntermediate
Monotonic Stack
A monotonic stack is a stack that keeps its elements in increasing or decreasing order to answer range queries in linear time.
#monotonic stack#next greater element#previous smaller element+12