ELI5: Explain Like I'm 5

Geometry of binary search trees

A binary search tree is like a tall bush. It starts with one branch at the top, and then branch after branch after branch keeps branching off that top branch until there are lots of branches. Just like a bush, each branch has two parts, or sides. The left side has smaller numbers than the right side. At the very end of the branches, there are what are called leaves. They are the parts that you don't branch off any more.

To get from the top of the bush to the leaves, you have to keep choosing which side of the branch you want to go to. If you want to find a number, the computer will start at the top, and then look to see if the number it is looking for is bigger or smaller than the number on the branch it is on. Then it will choose the side with the right number, and go down that side until it finds the right number.

This is how a computer can use abinary search tree to find a number quickly. It has to be careful not to go down the wrong side though!