arrayscomplexity
Amortized constant time is not constant time every time
Anonymous
with geometric capacity growth, most dynamic-array appends take O(1) work, while a resize can copy O(n) elements. Across n appends, the total copying is O(n), so append is O(1) amortized rather than O(1) for every operation.
0