Introduction
Reference:
Types of binary trees:
- full binary tree
- complete binary tree
- perfect binary tree
1. full binary tree:
A full binary tree (sometimes proper binary tree or 2-tree) is a tree in which every node other than the leaves has two children.
0
/ \
1 2
/ \
3 4
2. complete binary tree:
A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.
0
/ \
1 2
/ \ / \
3 4 5
3. perfect binary tree:
A complete binary tree is a full binary tree, and it is also a complete binary tree.
0
/ \
1 2
/ \ / \
3 4 5 6