The Runtime Theory
Programming & AlgorithmsPlanned

Why Big-O Does Not Predict Every Run

Video not available yet
#complexity#binary-search#performance

This planned lesson starts with two correct ways to search a sorted array: a scan and binary search. An animation shows the scan's neighboring memory accesses beside binary search's shrinking interval and jumping probes. The narration distinguishes the comparison count from elapsed time, then explains how input size, cache locality, branch behavior, and implementation constants affect a real run.

The demonstration plots repeated measurements for increasing arrays and labels the graph as an example workload, not a universal result. It closes by asking viewers to state the algorithm's invariant, asymptotic bound, and likely hardware cost separately. Companion material: algorithm article and binary-search flow.

Related articles

More in Programming & Algorithms

New lessons by email

Get new articles and notes on the systems behind everyday software.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save