Updated: Jun 29, 2020
In the previous post of Binary tree, we learned about the Binary tree and its properties.
In this post, common types of binary trees are discussed.
1) Full Binary Tree: A Binary Tree is a full binary tree if every node has 0 or 2 children.
2) Complete Binary Tree: A binary tree is complete Binary Tree if all levels are completely filled except possibly the last level and the last level has all keys as left as possible. All the leaf elements must lean towards the left.
3) Perfect Binary Tree: A binary tree is a Perfect Binary Tree in which all internal nodes have two children and all leaves are at the same level.
4) Balanced Binary Tree: It is a binary tree structure in which the left and right sub-trees of every node differ in height by not more than 1.
5) Degenerate Binary Tree: It a tree where every internal node has one child. Or we can say that each parent node has only one associated child node. Which means it will behave as a linked list.
20 / 30 \ 40 \ 50
Follow us on Instagram @programmersdoor
Join us on Telegram @programmersdoor
Please write comments if you find any bug in the above code/algorithm, or find other ways to solve the same problem.
Follow Programmers Door for more.