Delete has to descend just like insert does. Today you make Delete walk down to the leaf that holds a key and remove it there, so deletion works in a multi-level tree - rebalancing comes next.
Descend to the correct leaf in a multi-level tree and remove a key, leaving the rest of the tree untouched.
Delete mirrors insert’s descent: route the key down through the internal nodes to the one leaf that could hold it, then remove its entry there. In this lesson the leaf still has plenty of keys after the removal, so nothing more is needed - the change is local to that leaf and the rest of the tree, separators included, stays exactly as it was.
That “plenty of keys left” assumption is doing real work, and the next lessons pay it off. A leaf that drops below the minimum occupancy (for order 3, below one key) has underflowed and can no longer stand alone - it must either borrow a key from a neighbor or merge with one. Today establishes the descent and the plain removal; the rebalancing that keeps a shrinking tree legal is built on top of it, one repair at a time.
func (t *Tree) delete(id, key uint64) bool {b := t.pager.ReadPage(id)if nodeType(b) == nodeLeaf {// remove from this leaf (lesson 15), write it back}// internal: recurse into childIndex; rebalancing is the next lessons}