Demonstrating a series of insertions into a dynamic array data structure, implemented using simple geometric expansion. Black squares indicate entries in the underlying array that are in use to hold dynamic array data, and grey dotted squares indicate entries in the underlying array that are reserved for future expansion. Most insertions are fast, while slow insertions (those which may need to reallocate memory and/or copy the entire array contents) are labelled with turtles. The logical size and capacity of the dynamic array after all insertions are complete is labelled. Turtle images based on public domain file File:Turtle-icon.svg.
Own work
Dcoetzee