To start with the basics, it is very important to understand the binary tree in order to understand its various types.
A tree is a binary tree if and only if: -
- It has a root root, which may not have child nodes (0 child nodes, NULL tree)
-Root node can have 1 or 2 child nodes. Each such node forms the ebony itself
- The number of child nodes can be 0, 1, 2 ....... no more than 2
- there is a unique path from the root to any other node
Example:
X / \ XX / \ XX
Getting started with your requested terminology:
A binary tree is a complete binary tree (height h, we root node as 0) if and only if: -
Level 0 to h-1 is a complete binary tree of height h-1
- One or more nodes of level h-1 may have 0 or 1 child nodes
If j, k are nodes of level h-1, then j has more child nodes than k if and only if j is to the left of k, i.e. at the last level (h), there may be no nodes of the sheet, those present must be shifted to the left
Example:
X / \ / \ / \ XX / \ / \ XXXX / \ / \ / \ / \ XXXXXXXX
A binary tree is a strictly binary tree if and only if: -
Each node has exactly two child nodes or nodes
Example:
X / \ XX / \ XX / \ / \ XXXX
A binary tree is a complete binary tree if and only if: -
Each non-leaf node has exactly two child nodes
All leaf nodes are on the same level.
Example:
X / \ / \ / \ XX / \ / \ XXXX / \ / \ / \ / \ XXXXXXXX / \ / \ / \ / \ / \ / \ / \ / \ XXXXXXXXXXXXXXXX
You should also know what an ideal binary tree is?
A binary tree is an ideal binary tree if and only if: -
- full binary tree
- all leaf nodes are on the same level
Example:
X / \ / \ / \ XX / \ / \ XXXX / \ / \ / \ / \ XXXXXXXX / \ / \ / \ / \ / \ / \ / \ / \ XXXXXXXXXXXXXXXX
Well, sorry, I can’t post the images since I do not have 10 reputation. Hope this helps you and others!