Doubly and Circular Linked Lists
Lesson 10 of 20Watch head and tail rewire a doubly list in O(1), then follow a ring that loops back onto its own head.
A recent-files list: newest document at the head. Watch nodes get born wired, unlinked and spliced back — four pointer writes per move.
Inserting 6 between 12 and 37: wire the NEW node first, then touch the neighbors — reverse the order and you lose the right side.
A doubly list built and rewired by hand, then a ring counted the circular way. Nodes render as {data, ←prev, →next}.
The same list drawn as a ring: the loop-back edge from tail to head is real, and the walk stops on p == head.
A backward walk — only a doubly list can do this.
Click a term, then click its meaning to lock the pair.