Queue

A queue is a collection of entities where you can add entities to one end and remove them from the opposite end.

Comparable to a waiting-line processed in FIFO (First-In-First-Out) order, queues are used less frequently compared to stacks. However, variations of queues such as Deque or Priority Queue are useful in various fields.

Furthermore, they are widely used when implementing Breadth-First Search (BFS) or caches.

Last updated