B+ Tree Simulator

A B+ Tree is a balanced multiway search tree in which all records are stored in the leaf nodes. Internal nodes contain only separator keys, and the leaves are linked from left to right for efficient ordered scans and range queries.

Point searchO(log n)
InsertO(log n)
Range queryO(log n + k)
Leaf traversalO(n)

Tree operations

400 ms
B+ Tree visualizationInteractive B+ Tree with separator keys and linked leaves.

Example B+ Tree loaded. Choose an operation.

Records0
Nodes0
Height0
Splits0

Search path

Query result

B+ Tree insertion idea

find the target leaf
insert the key in sorted order

if the leaf overflows:
  split the leaf
  copy the first key of the new right leaf
  into the parent

if an internal node overflows:
  split it
  promote its middle separator key

B+ Tree concepts

Records live in leaves

Internal keys guide the search. Every inserted record remains in exactly one leaf.

Separator copies

When a leaf splits, the first key of the new right leaf is copied into the parent and also remains in the leaf.

Linked leaves

Leaf nodes form a left-to-right chain, allowing a range query to continue sequentially after the first matching leaf is found.

Balanced height

Every root-to-leaf path has the same length, keeping point searches logarithmic.

B-Tree versus B+ Tree

PropertyB-TreeB+ Tree
Record locationInternal or leaf nodesLeaf nodes only
Internal keysMay represent recordsSeparator copies only
Leaf linksUsually absentTypically linked
Range queriesTree traversalLeaf-chain scan