arrayscomplexity
Dynamic arrays trade occasional copying for cheap appends
Anonymous
With geometric growth, appending is amortized O(1), not worst-case O(1): a resize may copy all existing elements. Across n appends, total copying is O(n). For one append, mention the possible O(n) resize.
0