← Pointer Manipulation

Micro-Drill #23 — Insert at head

Pointer Manipulation Target: 10s

Head insertion is O(1) and builds lists in reverse. Core for reverse-linked-list.

new = Node(val)
new.next = head
head = new

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #22 Micro #24 →