Binary Tree
A tree with each node consisting of at most two children
Height
- Max: (spindly)
- Min: (bushy)
- Average:
- We want bushy trees because they are more efficient
Categories
- Full
- All nodes have either 2 children or 0 children (leaf nodes)
- Perfect
- Full binary tree of height with exactly nodes ( is 1-based)
- Means every branch goes all the way to the end of the tree
- nodes → height
- Implies complete and full (but not visa versa)
- Complete
- A perfect binary tree through level with some extra leaf nodes at level
- Extra nodes are filled from left to right
- nodes → height
- Binary Search Tree