Duck Icon

Lander's blog

A dynamic array is an array-backed data structure that resizes itself automatically at runtime

Previous: An array is a data structure that stores elements of the same type sequentially in memory

A dynamic array is an array-backed data structure that resizes itself automatically at runtime. A basic implementation is about the size of three pointers on the stack: one for data, one for capacity, and one for size. Capacity and size differ in that capacity is current limit to how many elements the dynamic array can contain before needing to resize, where size is the actual count of elements.