AlgoScope

Dynamic Array

Data structurebeginnerLinear Structuresalso called ArrayList, Vector, growable array

An array that doubles its capacity when full, so appends are amortized O(1).

Decision · step 2 of 9Dynamic Array: Append five values
3✓01

Append 3 at index 0. Size 1 of 2.

Open in the player →or start at step 2

What you will see

FILL -> FULL -> ALLOCATE 2x -> COPY -> CONTINUE; empty capacity slots are visible.

How dynamic array works →

Cost

accessO(1)
appendO(1) amortized
insertO(n)
deleteO(n)
SpaceO(n)

Append is O(n) on the resize step and O(1) otherwise; amortized O(1).

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Before this

Leads to

Topics that need this one first.