B / B+ / B* Tree Explorer
▶ DRILLSwitch between B-tree, B+ tree, and B* tree — all at t=2, initialized with the same 20 keys. Add, delete, or search 1–99 and observe how the structure and split behaviour differ. A comparison table summarises the key differences.
B-tree (t=2): Keys stored in every node — internal and leaf. Search terminates as soon as the key is found, at any level. Splits move the median key up; each split creates two ~50%-full nodes.
B-tree t=2 · max 3 keys/node · seed 42 · 10 nodes
# comparison
| Property | B-tree | B+ tree | B* tree |
|---|---|---|---|
| Data in nodes | All nodes | Leaves only | All nodes |
| Internal nodes | Routing + data | Routing only | Routing + data |
| Search ends at | Any level | Always leaf | Any level |
| Leaf chain | No | Yes — enables range scan | No |
| Min fill (non-root) | 50% (≥1 key) | 50% (≥1 key) | 67% (≥2 keys) |
| Split strategy | 1 full node → 2 half-full; median moves up | Leaf: copy key up (stays in right child); Internal: same as B-tree | Redistribute to sibling first; if both full: 2 nodes → 3 (higher avg fill than binary split) |
| Best for | General-purpose; fewer levels when data fits in internal nodes | Database indexes, file systems; range queries use leaf chain | High-occupancy storage; fewer splits = better write throughput |