Notes

Search

Search IconIcon to open search

B-Tree

Last updated Dec 28, 2022

B-Trees are a kind of self-balancing BST.

B-Trees

To start, let’s make a rule to never add a new leaf. Instead, we’ll just add any new value to a node.

But this node can get quite big, and our data structure will degenerate to a linked list. That’s no good. Instead, let’s set a limit $L$ on the number of items that can be stored in our node.

Examining a node costs us $O(L)$ compares, but that’s fine since L is constant.

What if we split non-leaf nodes?

Terminology

Splitting Trees are B-Trees. B-Trees of order $L = 3$ are called 2-3-4 trees or 2-4 trees.

Note that the origin of the name “B-Tree” is unclear. “Broad”, “Bushy”, and “Balanced” are all possible explanations. The most likely one is “Bayer”, since the first paper on B-Trees was written by Bayer.

B-Trees in Practice