Does it do what it claims?
Examples build intuition, but invariants, induction, exchange arguments, and contradiction explain why every valid input is handled correctly.
An algorithm is a precise process for transforming state. First choose the problem family; then study the representation, legal transitions, proof of correctness, termination, and resource growth.
The six destinations remain peers in the curriculum. This atlas groups them only by the kind of question they ask: transforming or exploring state on the left, designing and evaluating procedures on the right.
Breadth-first search removes the oldest discovered node from a queue. Depth-first search removes the newest discovered node from a stack. Both avoid cycles by recording discovery before expansion.
Every node enters the frontier at most once. The frontier contains discovered work that has not yet been expanded.
Queue: expand the earliest discovered node first. This finds minimum-edge paths in an unweighted graph.
Bubble sort is deliberately simple rather than efficient. Each pass compares neighboring values and pushes the largest remaining value into the sorted suffix.
After pass k, the k largest values occupy their final positions at the right edge. The unsorted prefix shrinks as the invariant grows.
The highlighted pair is the only local comparison happening now. The green suffix has already reached its final order.
The vertical axis below is a direct toy operation count, not a logarithmic transformation. Smaller families will hug the baseline when quadratic growth dominates, which is precisely the relationship the chart is meant to reveal.
O(n²) performs about 6.4 times as many toy operations as O(n log n) at this input size.
Big O describes a family of growth under a stated input and operation model. It is not an exact stopwatch prediction.
Examples build intuition, but invariants, induction, exchange arguments, and contradiction explain why every valid input is handled correctly.
Time and space depend on input size, representation, assumptions, and which operations are counted. Big O summarizes growth, not exact seconds.
The same problem changes when information is stored as an array, tree, graph, heap, hash table, or stream.