
dynamic arrays
A dynamic array is a flexible storage structure in programming that can grow or shrink as needed. Unlike fixed arrays, which have a set size, dynamic arrays automatically resize when you add or remove elements, ensuring efficient use of memory. They achieve this by allocating a larger block of memory than currently needed, and then resizing when full. This allows for easy expansion without prior knowledge of the total number of items and maintains quick access to elements by their position. Dynamic arrays are commonly used in situations where data size varies over time.