AlgoScope

Array Insert

AlgorithmbeginnerArray Techniques

Make room by shifting everything after the slot one place right, then write.

Result · step 2 of 6Array: Insert 7 at index 2
501142234856i

Move 8 from index 4 to index 5.

Open in the player →or start at step 2

What you will see

Cells slide right one at a time, opening a gap; the new value drops in.

How array works →

Cost

BestO(1)
AverageO(n)
WorstO(n)
SpaceO(1)

Best case is insertion at the end.

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, predict what happens next.

Screen readers: Each cell is announced as index, value and state; each step's accessibility text states the decision and its effect.

Reduced motion: Swaps and shifts become value crossfades with an outline flash; pointers appear at their destination.

Before this

Taught by the same lesson

Array covers these too, in the same run.