Stacks & Queues
LIFO and FIFO. Monotonic variants crack the whole next-greater family.
Newinterview weight 7523 problems1 visualisers
18
mastery
Attempts logged
0
Predicted success on the next one
33%
Solved here
0 / 23
What you actually need to hold in your head
- Matching and nesting problems are stack problems
- A monotonic stack gives next greater in linear time
- A deque tracks window extrema
- Two stacks simulate a queue in amortised O(1)
Watch it run
Step through the algorithm before you write it.
Patterns in this topic
The trigger phrases are what you are training yourself to notice.
Stacks & Queues problems
Ordered by sheet phase, so the early ones are the highest signal.
0 / 23 solved