LeetCode ยท Queue

Queue Problem Set

FIFO problems โ€” level-order traversal, shortest paths on unweighted graphs, multi-source spread, ring buffers, and queue-powered scheduling.

Concept page: Queue
DifficultyPatternProblemKey Insight
MediumbfsLC 102 ยท Binary Tree Level Order TraversalSnapshot queue.size() at each level so children join the next layer, not the current one.
MediumbfsLC 200 ยท Number of IslandsFlood-fill each new island with BFS so every land cell is counted exactly once.
Mediummulti-sourceLC 994 ยท Rotting OrangesStart BFS from all rotten oranges simultaneously โ€” each level is one minute of spread.
MediumdesignLC 622 ยท Design Circular QueueUse a fixed array plus head and size to distinguish full from empty cleanly.
Mediumgreedy+queueLC 621 ยท Task SchedulerA cooldown queue tracks when tasks become available again while a heap picks the next best task.
HardmonotonicLC 239 ยท Sliding Window MaximumA monotonic deque keeps the current maximum at the front and evicts useless indices from the back.

โ† Back to all LeetCode categories