AlgoScope

Insert at Tail

AlgorithmbeginnerLinked List Operations

Walk to the last node and attach the new node after it.

Result · step 5 of 6Singly Linked List: Insert at the tail
5✓1✓4✓2✓9✓head

2 is the last node: point its next at the new node 9.

Open in the player →or start at step 5

What you will see

A pointer walks to the end; the last node's null arrow reattaches to the new node.

How singly linked list works →

Cost

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

O(1) with a tail pointer.

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.

Before this

Taught by the same lesson

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