Amortized Analysis
Average cost per operation over a sequence, even when a few operations are expensive.
Decision · step 2 of 14Complexity in Numbers: Appends to a doubling array
Append 1: room for it, one write. Cost 1, total 1, average 1.0.
What you will see
Dynamic array appends: most cost 1, a few cost n; the running total stays under 3n.
Cost
| Space | O(1) |
|---|
How you work with it here
explore, compare two runs, run it on your own input.
Screen readers: Growth curves are described in words and as a table of operation counts for sample input sizes; each concept has a one-sentence spoken definition.
Reduced motion: Curves and counters update without animation.
Before this
Leads to
Topics that need this one first.
Taught by the same lesson
Complexity in Numbers covers these too, in the same run.