Algorithms

Binary search tree

A binary tree where, at every node, everything on the left is smaller and everything on the right is larger. That way you search by discarding one side at each step.

Example

With root 8, left 3 and right 10, searching for 10 is 2 steps: 8, and since 10 is larger, go right.

Test yourself: Binary search tree

Binary search trees

In a binary search tree, a node's whole left subtree is ___ than it.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.