October 2025
Intermediate to advanced
485 pages
13h 2m
English
B-tree deletion follows yet another clever algorithm. Finding a value in a leaf node and deleting the value isn’t a big deal itself, but what happens when we delete a value from an internal node? Let’s take this tree, again, for an example:

Imagine that we have to delete the 20. We’d end up with a root node that has one value, but three children, which would completely mess up the B-tree structure.
Because of this, B-tree deletion does the opposite of what insertion does. While insertion causes nodes to split in order to grow the tree, deletion fuses empty (or close to empty) nodes together in order to shrink the tree.
More specifically, ...
Read now
Unlock full access