← Lab

🔗 Linked List — nodes & pointers

Nodes joined by next pointers. Insert/remove at a known node is O(1) (rewire), but finding one is O(n). Reverse flips every pointer.

length
3
head
1
tail
3
index access
O(n)
head → â€Ķ → null
head→1next→2next→3next→null
what just happened (say it out loud)

Run an operation to see it step by step.

ė‚Žėƒ: a linked list trades O(1) index access for O(1) structural edits: because nodes are separate allocations wired by pointers, inserting/removing is just rewiring — but there's no address arithmetic to jump to index i, so search is O(n).
â–ķ deep-dive videos — “linked list reverse pointers explained”