AlgoScope

Reverse Array

AlgorithmbeginnerArray Techniques

Swap the outermost pair and step both pointers inward until they meet.

Result · step 7 of 8Two Pointers: Reverse in place
7✓06✓15✓24✓33✓42✓51✓6leftright

The pointers meet on 4. The middle value never moves.

Open in the player →or start at step 7

What you will see

Two pointers walk toward each other; each pair crosses paths.

How two pointers works →

Cost

BestO(n)
AverageO(n)
WorstO(n)
SpaceO(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, 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.

Leads to

Topics that need this one first.