🧮Binary Tree
Also known as Binary Trees
A tree where each node has at most two children, a left and a right.
Think of it like
Think of it like a path that splits in two at each fork. It never splits in three.
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.
Definition
Common mistake
Key takeaways
- 1Two children at most. Left and right.
- 2Shallow when balanced. About 20 levels for a million.
- 3A base for others. Search trees and heaps.