Overview

B-trees are balanced search trees specifically designed to minimize disk I/O operations, making them ideal for database systems and secondary storage applications. Unlike binary search trees, B-tree nodes can have thousands of children, yielding a very low height of O(log_t n) where t is the minimum degree. This chapter defines B-trees, presents search, insertion (with proactive node splitting), and deletion operations—all executable in a single downward pass through the tree.

Key Concepts

Algorithms and Techniques

B-TREE-SEARCH(x, k)

Generalizes binary search tree lookup to multiway branching. At each node x, a linear scan finds the smallest index i such that k ≤ x.key_i, then either returns the key (if found), reports failure (if x is a leaf), or recurses into the appropriate child after a DISK-READ.

B-TREE-CREATE(T)

Allocates an empty root node, sets it as a leaf with zero keys, writes it to disk. Runs in O(1) time and O(1) disk operations.

B-TREE-INSERT(T, k) — Single-pass insertion with proactive splitting

B-TREE-DELETE(x, k) — Single-pass deletion

Handles three main cases in a single downward pass:

  1. Case 1: k is in leaf node x — simply remove it.