Explore modules

B-Tree Visualization

Visualize B-Tree node splitting, key insertion, and tree balancing with customizable degree parameters.

Free theory article

Visualize B-Tree node splitting, key insertion, and tree balancing with customizable degree parameters.

Concept & interpretation

A B-Tree is a self-balancing multi-way search tree in which each node stores multiple sorted keys and can branch to more than two children. By grouping up to 2t − 1 keys inside a single node and splitting full nodes preemptively on the way down during insertion, a B-Tree keeps all leaves at the exact same depth and bounds tree height to O(logt n), minimizing block reads in storage engines and databases.

Interactive Experiment: What to Enter and Observe

Open the B-Tree Visualization module to reproduce the split trace above and compare how minimum degree t controls tree height:

  1. Move the Minimum Degree (t) slider from 3 to 2. Check the Properties card at the bottom of the panel: Min keys/node: 1 and Max keys/node: 3.
  2. Type 10, 20, and 30 into the Insert key (e.g. 42) input (pressing Enter or the Insert key + button after each). Observe all three keys packed inside a single root node [10 | 20 | 30].
  3. Insert 40. Observe the full root immediately split around median 20 into a two-level tree with root [20] and children [10] and [30 | 40].
  4. Insert 50 and then 60. Watch [30 | 40 | 50] split on the 60 insertion, promoting 40 into the root [20 | 40] while keeping all three leaf nodes on the exact same horizontal level.
  5. Drag Minimum Degree (t) to 3 (which resets the tree and raises Max keys/node to 5) and click Random Insert six times: notice the first 5 keys stay in one root node and the 6th insertion triggers the first root split around the 3rd sorted key.
Read the full free theory article