All tree types

Binary search tree

The plain one. Nothing keeps it balanced, so the order values arrive in decides its shape — sorted input makes a stick.

Build the tree

Walk the tree in each order — nodes light up as they print in the strip below it.

Course examples

Each one clears the tree first and inserts from scratch.

The insertion example from the binary search trees page.

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.

Nodes: 0 of 24

Height:

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

step 0 / 0