Multi-Way Search Trees

B-Tree Visualizer

Choose a minimum degree, insert keys, and watch how the tree splits and keeps its nodes balanced.

Control the tree

Insert values into a B-tree and inspect how the structure rebalances itself.

Ready for your first insertion.

B-tree rule

A B-tree keeps each node between t - 1 and 2t - 1 keys.

  1. Each node stores keys in sorted order.
  2. Every internal node has at most 2t children.
  3. A node with k keys has k + 1 children when it is internal.
  4. All leaves stay at the same depth.
  5. Splits happen when a node exceeds its maximum key count.

Live tree

Each box represents one B-tree node.

Set a degree and insert a value to build the tree.

Operation log

The latest insert, search, or delete sequence is shown here.

The split and navigation steps will appear here.