Arrays
Ordered indexable collection for O(1) access by position.
Priority queue backed by a binary heap for fast min or max access.
Pop scores out of a max-heap one at a time to hand out gold, silver, bronze and plain placement numbers.
Always join the two shortest sticks, pulled from a min-heap, to reach the cheapest total joining cost.
Use a max-heap to find the biggest pile each second, shrink it to its square root, and total what is left.
Keep free cinema seats in a min-heap so every booking gets the smallest free seat and returned seats are reused.
Spend the two most common letters each round, taken from a max-heap of counts, so no two neighbours match.
Provisionally use a ladder on every climb, then let a min-heap convert the smallest climbs back to bricks.
Sort meetings by start time and track room end times in a min-heap to count the rooms actually needed.
Walk engineers from highest efficiency down while a min-heap of speeds keeps only the k fastest on the team.
Hold one number per sorted list in a min-heap and repeatedly advance the smallest to shrink the covering range.
Remember every station driven past in a max-heap and cash in the biggest tank only when the car runs short.
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.
First-in, first-out collection for scheduling, BFS, and buffering.
Key-to-value lookup in average O(1) via hashing into buckets.
Hierarchical nodes with parent–child links for ordered and nested data.