Amortized analysis measures the average cost per operation over a sequence, even when individual operations occasionally cost much more. It explains why a dynamic array's append is "O(1) amortized" despite occasional O(n) resizes.
The dynamic array example
When a dynamic array fills up, it allocates a new array (usually ) and copies all elements — an O(n) step. But because capacity , expensive copies become exponentially rarer.
