Type of Trees
A binary tree is a special type of tree that offers a lot of practical applications in the field of computer science.
Binary tree is a specific type of tree in which each node can have at most two children namely left child and right child.
There are various types of binary trees:
- Strictly binary tree
- Full binary tree
- Complete binary tree
Strictly Binary Tree:
A binary tree in which every node, except for the leaf nodes, has non-empty left and right children.
Full Binary Tree:
A binary tree of depth d that contains exactly 2^d- 1 nodes.
Depth = 3
Total number of nodes = 2^3- 1 = 7
Complete Binary Tree:
A binary tree in which all levels, except possibly the deepest level, are completely filled and at the deepest level, all nodes are as far left as possible.