There are 5 types of trees: Full binary tree, Complete binary tree, Perfect binary tree, Balanced binary tree and Degenerate binary tree.
Full binary tree
A full binary tree is a special type of binary tree in which every node has either zero or two children. In other words, each node in a full binary tree has either 0 or 2 child nodes.
Complete binary tree
A complete binary tree is a binary tree in which all levels are filled except possibly the last level. In other words, a complete binary tree is a tree in which all nodes are as far left as possible on each level.
Perfect binary tree
A perfect binary tree is a special type of binary tree in which all internal nodes have two children, and all leaf nodes are at the same level or depth. Additionally, a perfect binary tree is perfectly balanced.
Balanced binary tree
A balanced binary tree is a type of binary tree in which the heights of the two subtrees of any node differ by at most one. In other words, a balanced binary tree aims to minimize the difference in height between the left and right subtrees of each node.
Degenerate tree
A degenerate tree is also known as a skewed tree. It is a type of binary tree in which each parent node has only one child or no child at all.
Traversals In Binary Tree
INORDER TRAVERSAL
The inorder traversal visits the nodes in a specific order: left subtree, current node, right subtree.
PREORDER TRAVERSAL
In preorder traversal, the root node is visited first, followed by the left subtree, and then the right subtree.
POSTORDER TRAVERSAL
In postorder traversal, we first visit the left subtree, then the right subtree, and finally the root node.