Explain like I'm five · Systems

What is a Binary Tree / BST?

Binary trees and BSTs, told as a story about a shelf map where every fork picks left or right to find a part.

124786331195427need to find part #27, but they're all jumbled upyou have to open them one by one — worst case, every single box

With jumbled numbers, you open boxes one by one down the line.Worst case, you open every single box.

812192731475463even lined up smallest to largest, in one rowfollow the row from the front, and it's still one box at a time

Even sorted in a neat row, following it from the front is still one box at a time.Follow the row from the front, and it's still one box at a time.

3112548194763binary tree search = pick left or right at every fork, halving the candidateslooking for 19: smaller than 31, go left → bigger than 12, go right → 19

Binary tree search = a map that halves the candidates at every fork.Looking for 19: smaller than 31, go left → bigger than 12, go right → 19.

Nodeone fork, a square with a part number
Left < Me < Righta smaller number goes left, a bigger one right
Halving Each Stepeach step cuts the candidates in half
Balancea lopsided tree loses the halving benefit
31<31>31smaller goes leftbigger goes rightBST RULEleft < me < rightevery fork follows this rule: smaller left, bigger right

If the number you want is smaller than the fork's, go left; if bigger, go right.Every fork follows this rule: smaller left, bigger right.

311247819a balanced tree halves the candidates every step8121927a tree leaning all one way is just a line againthat's why algorithms exist just to rebalance the tree

A tree leaning one way makes the search as slow as a plain line again.That's why algorithms exist just to rebalance the tree.

In one breath

Binary tree = a map that branches only left or right at every fork. A binary search tree (BST) adds one rule: smaller values go left, bigger values go right.

A binary tree is a tree structure where each node has at most two children (left and right). A binary search tree (BST) adds the rule that every value in the left subtree is less than the node, and every value in the right subtree is greater — giving average O(log n) search, insert, and delete. But if insertions skew one way, the tree degenerates into a line, with worst-case O(n); self-balancing trees like AVL or red-black trees exist to prevent that.

When grown-ups say it

Node
One fork, a square with a part number. Has at most two branches, left and right.
BST Rule
Smaller to the left, bigger to the right. Holds true at every single fork.
Balance
Keeping the tree from leaning to one side. Lean too far, and search slows back to a line.
Stack/Queue (linear structures)
Rules for a single line — stacking or queuing. The branch-free, single-line structures live here. → boxes get stacked, cars get queued
Time Complexity
The ruler for how time grows as data grows. A balanced tree is O(log n); a plain line is O(n). → how much slower as cars pile up
Cache Memory
A small toolbox holding only the frequent tools. A different way to be fast: keep frequent items close. → the toolbox kept right beside you
Virtual Memory/Page Table
The table matching virtual slots to real ones. Page tables themselves are often implemented as tree structures. → the fake map that makes the whole warehouse yours
CPU Scheduling
The rule that sets the car order on the board. Some schedulers use tree structures internally too. → who gets the lift first
Next story
How Much Slower as Cars Pile Up →
Want another term as a picture book? Request →