All tree types

2-3 tree

Balanced by construction. A node holds one or two values; when a value would make three, the node splits and pushes its middle value up — so every leaf stays on the same level.

Build the tree
Course examples

Each one clears the tree first and inserts from scratch.

Nine values in a helpful order — the tree stays short.

The same nine values in order. The tree becomes a stick, and searching it is no better than scanning a list — this is why the balanced trees exist.

The 2-3 trees page's worked example. In a 2-3 tree, 10 splits the first full leaf into a new root, and 60 splits again, giving [30,60] over 10, 50, 70.

Values: 0 of 24

Height:

Insert a value, or load one of the course examples.

step 0 / 0