Arrays
Ordered indexable collection for O(1) access by position.
Last-in, first-out collection for undo, parsing, and nested work.
Use a stack to check that every opening bracket is closed by the matching closing bracket in the right order.
Build a stack that also reports its smallest value instantly, by storing a running minimum beside every pushed value.
Keep a score record on a stack, where each operation records, cancels, doubles or sums the most recent scores.
Cancel equal neighbouring letters in one pass by popping the stack whenever the next letter matches the top.
Evaluate an expression where operators come after their numbers, by pushing numbers and folding each operator into one result.
Expand nested k[text] patterns using two stacks that park the repeat count and the text built before each bracket.
Track surviving asteroids on a stack, where each left-moving asteroid fights the top until one of them is destroyed.
Turn a Unix file path into its canonical form by pushing folder names and popping one off for every ".." part.
Evaluate a sum with brackets by parking the running result and the current sign on a stack whenever a bracket opens.
Find the biggest rectangle under a row of bars with a monotonic stack that measures each bar as soon as a shorter one arrives.
Ordered indexable collection for O(1) access by position.
Nodes linked by pointers — insert and delete without shifting a contiguous block.
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.
Priority queue backed by a binary heap for fast min or max access.