Arrays
Ordered indexable collection for O(1) access by position.
First-in, first-out collection for scheduling, BFS, and buffering.
Build last in, first out stack behaviour out of a single queue by rotating it after every push.
Count the requests from the last 3000 milliseconds by dropping expired times off the front of a queue.
Report the average of the last few numbers in a stream using a queue plus a running sum.
Simulate students rotating to the back of a queue and count how many are left when the line gets stuck.
Build a fixed size queue inside one block of memory, wrapping the back around to the start with modulo.
Extend the circular buffer idea so values can be added and removed at both ends in constant time.
Order a deck so the reveal routine shows cards smallest first, by running that routine on positions.
Decide which party wins by racing two queues of seat numbers and banning the later senator each round.
Ordered indexable collection for O(1) access by position.
Nodes linked by pointers — insert and delete without shifting a contiguous block.
Last-in, first-out collection for undo, parsing, and nested work.
Key-to-value lookup in average O(1) via hashing into buckets.
Hierarchical nodes with parent–child links for ordered and nested data.
Priority queue backed by a binary heap for fast min or max access.