Every basics visualization on this site on one map. The branches are the main ideas. Each leaf is a page; the grey line under it is the one thing to remember about it. Click a branch to focus on it, click a page to open it.
Recall mode hides the page names. Read the hint, say the name, then click the "?" to check.
1. How the map is organized
The map at a glance: 5 branches, 12 pages.
Ask what the page is about:
How fast is an algorithm? That is Big-O: count the steps as n grows.
Which item comes out next? The last one in is a stack; the first one in is a queue. Each is shown with an array and with a linked list.
Are two items in the same group? That is disjoint sets.
2. The structures side by side
Branch
Main operations
Time
Array or linked list
Stacks
push, pop, peek
O(1)
array: fixed size; list: grows freely
Queues
enqueue, dequeue
O(1)
array: circular; list: head and tail
Disjoint sets
find, union
near O(1), α(n) amortized
parent array
3. Five facts to remember
Big-O keeps the fastest-growing term and drops constants: 3n² + 5n is O(n²).
A stack is last in, first out; a queue is first in, first out.
An array queue must wrap around (circular), or dequeues leave unused cells at the front.
A linked-list stack needs only a head pointer; a linked-list queue needs head and tail.
With union by rank and path compression, union-find runs in near-constant amortized time.