# Binary Tree

> A tree where each node has at most two children, a left and a right.

**Field:** Software Development  
**Category:** Algorithms & Data Structures  
**Also known as:** Binary Trees

## Think of it like

Think of it like a path that splits in two at each fork. It never splits in three.

## Definition

A binary tree is a tree where each node has at most two children, called left and right. That simple rule makes it easy to store and to walk through. Many faster structures are built on it, like the binary search tree and the heap. A balanced binary tree with a million nodes is only about 20 levels deep. That depth is why searches in one can be so quick.

## Example

Lucy draws a binary tree for a game of twenty questions. Each yes or no answer goes left or right to the next question.

## Why it matters

It is the shape behind binary search trees, heaps and many indexes.

## Common mistake

Thinking every binary tree is sorted. Only a search tree keeps its values in order.

## Three principles

- **Two children at most.** Left and right.
- **Shallow when balanced.** About 20 levels for a million.
- **A base for others.** Search trees and heaps.

## Related terms

- [Tree (Data Structure)](https://learn.benibix.com/term/development/tree)
- [Binary Search Tree (BST)](https://learn.benibix.com/term/development/binary-search-tree)
- [Heap (Data Structure)](https://learn.benibix.com/term/development/heap)
- [Recursion](https://learn.benibix.com/term/development/recursion)

---

Source: https://learn.benibix.com/term/development/binary-tree
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
