Algorithms

Binary tree

A structure where each element has at most 2 children, one on the left and one on the right, and all hang from a single one at the top, the root.

Example

A full binary tree of 3 levels has 1 + 2 + 4 = 7 elements; one of 20 levels, over 1 million.

Test yourself: Binary tree

Binary trees

In a binary tree, each node has at most ___ children.

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.