Skip to content

Queue [mp]

Micro pattern

Description

Process states in first-in, first-out order to preserve discovery or level order.

Problems

Level-order traversal

Process the current queue contents before their newly discovered successors.

Multi-source traversal

Seed a queue with all initially available states.

Frontier-based traversal

Generate successive BFS frontiers in discovery order.

Monotonic deque

Expire old indices at the front and remove dominated candidates at the back.