Binary Trees
Types of Binary Trees
Full Binary Tree - Every node has either 0/2 children. (Not 1)
Complete Binary Tree - All nodes are completely filled except the last level & the last level has all the nodes on as left as possible.
Perfect Binary Tree - All leaf nodes are at the same level.
Balanced Binary Tree - Height of tree at max log(N) [N = nodes]
Degenerate Tree - basically, skewed.
Traversal Techniques
Preorder traversal - Root -> left -> right
In-order traversal - Left -> root -> right
Post-order traversal - Left -> right -> root
Level Order traversal (BFS) - level-wise
Breadth First Search (Level Order Traversal)
When you think the answer may lie closer to the root node.
When you are asked to search by level.
Maximum depth of Binary Tree
Balanced Binary Tree
Items left :
Last updated