arrayscomplexity
Dynamic-array append is cheap on average
Anonymous
when capacity grows geometrically, append is O(1) amortized. Most appends write one slot; occasional resizes copy existing elements, but across n appends the total copying is O(n). A single resize can still take O(n).
0