Skip to content

Glossary: Coding Interviews

deque

Also written: collections.deque, popleft, double-ended queue

A Python list-like container from `collections` that is fast at both ends. BFS uses it as a queue, with `popleft()` taking the oldest item from the front.

Where the book teaches it

Related terms

BFS (breadth-first search)