II · Trees, with shape

Binary search tree

Sorted, but with shortcuts.

The story

Conway Berners-Lee (yes, Tim's father) described the first BST in 1960 while building software for the Ferranti Pegasus. The shape is so natural that several people invented it independently around the same time. Naive BSTs are also famous for degenerating to a linked list when keys arrive sorted.

How it works

Each node has a key and two children: smaller keys go left, larger right. Lookup descends the tree comparing at each step.

Where it lives

Pedagogy and not much else. Every "real" BST in production is balanced (AVL, red-black, B-tree). Naive BSTs survive in toy interpreters and CS courses.

The key insight

Sorted insertion order produces a height-n tree — exactly the disaster a tree was meant to avoid. Self-balancing variants are the only sane production choice.