Cost per operation averaged over a whole sequence of operations. An append that sometimes copies everything is still O(1) amortized if the expensive copies are rare enough.
Amortized analysis
Cost per operation averaged over a whole sequence of operations. An append that sometimes copies everything is still O(1) amortized if the expensive copies are rare enough.