Every interactive topic has a 16-part learning page: from what it is and how it sits in memory, to operations, code in four languages, complexity, common mistakes and practice.
A fixed-size block of same-type elements stored next to each other in memory, accessed by index in O(1).
Arrays that grow by allocating a larger block (usually 2×) and copying — O(1) amortized append.
Sequences of characters; often immutable, so building strings in loops needs care.
A chain of nodes where each node stores a value and a pointer to the next node.
Nodes with both next and prev pointers — O(1) deletion given a node.
The tail points back to the head; useful for round-robin scheduling.
A Last-In-First-Out (LIFO) collection: push and pop happen only at the top.
A First-In-First-Out (FIFO) collection: enqueue at the rear, dequeue from the front.
Fixed-size ring buffer queues (see the Queue visualizer for a working version).
Double-ended queues supporting O(1) insert/remove at both ends.
A hierarchical structure where every node has at most two children: left and right.
Left subtree < node < right subtree; inorder traversal yields sorted order.
Self-balancing BSTs that keep subtree heights within 1 using rotations.
Self-balancing BSTs with colour rules; used in many standard libraries.
Complete binary trees with the heap property; O(log n) push/pop for priority queues.
Prefix trees storing strings character by character; fast prefix queries.
Vertices connected by edges — the most general way to model relationships and networks.
Arrays of buckets indexed by a hash function; O(1) average lookup.
Key → value dictionaries built on hash tables (Map, dict, HashMap, map).
Collections of unique keys with O(1) average membership tests.
Strategies for two keys that hash to the same bucket.
Each bucket stores a list of entries that share the bucket.
Probe for another free slot (linear, quadratic, double hashing).
Tracks connected components with near-O(1) union and find.
Range queries and point updates in O(log n).
Binary indexed trees for prefix sums with O(log n) updates.
Balanced multi-way trees designed for disks and databases.
B-trees with all values in linked leaves; the index structure of most databases.
A stack kept increasing/decreasing to answer next-greater queries in O(n).
A deque kept monotonic for sliding-window maximum/minimum in O(n).