Dynamic Arrays
A dynamic array is an array-backed data structure that automatically increases its capacity when the existing storage becomes full. Examples include Java ArrayList and Vector. Internally, the implementation allocates a larger array and copies the existing elements into it.
Capacity is different from the current logical size.
When capacity is exhausted, a larger backing array is allocated.
Existing elements are copied into the new array.
The growth factor is implementation-dependent.
The resize operation itself is O(n), but ordinary append is amortized O(1).