0

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)
Comfortable with these first
This unlocks
Next in the path
Trees

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
1
EStacks & Queues
2
3
MStacks & Queues
4
MStacks & Queues
5
6
MStacks & Queues
7
MStacks & Queues
8
MStacks & Queues
9
MStacks & Queues
10
11
MStacks & Queues
12
HStacks & Queues
13
MStacks & Queues
14
HStacks & Queues
15
EStacks & Queues
16
MStacks & Queues
17
MStacks & Queues
18
19
MStacks & Queues
20
MStacks & Queues
21
22
23
MStacks & Queues