AlgoScope

Insert at Head

AlgorithmbeginnerLinked List Operations

Point the new node at the old head, then move head onto it. Nothing else shifts.

Result · step 2 of 4Singly Linked List: Insert at the head
95142head

Create the node 9 and point its next at the old head, 5.

Open in the player →or start at step 2

What you will see

The new node appears, its arrow attaches to the old head, then HEAD jumps to it.

How singly linked list works →

Cost

BestO(1)
AverageO(1)
WorstO(1)
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, try operations in any order.

Screen readers: Each node announces its value and what it points to; each step announces the pointer change ("node 3 now points to node 5").

Reduced motion: Pointer arrows redraw in place with a brief emphasis instead of animating the detach and reattach.

Leads to

Topics that need this one first.

Taught by the same lesson

Singly Linked List covers these too, in the same run.