One contiguous block, fixed capacity
A static array stores values side by side in one block of memory. The capacity is chosen when the array is created and cannot change.
Only the first length slots hold live values. To insert in the middle, every element after that index shifts right to make a gap. To delete, every element after the gap shifts left to close it.
length == capacity, insert fails — there is no free slot and the block cannot grow.capacity = 6 # make room at index i for j in range(length, i, -1): arr[j] = arr[j - 1] arr[i] = value length += 1
In languages like C, a fixed array looks like int arr[6].
Run the simulation
Dashed slots are unused capacity. Watch values slide when you insert or delete.
Insert and delete by index
Capacity stays at 6. Insert shifts right; delete shifts left. Full blocks refuse new values.
Static array mental model
Fixed block · shift to open or close a gap · no grow.
Chosen once
The block size is fixed. Unused slots stay empty until length grows into them.
Insert and delete
Middle inserts copy every later element one step right. Deletes copy them left.