Binary Trees:
Read about Trees Here:https://rishabhjainiitbhu.blogspot.com/2019/07/introduction-to-trees-c-data-structures.html
- Binary Trees are trees with the utmost two children.
- Strict/proper binary trees: Binary Trees in which each node can have either zero or two children.
- Complete Binary Tree: All levels except the last are completely filled, and all nodes are as left as possible, as shown in the image.
- Perfect binary tree: a Binary tree with all the levels filled.
- Max number of nodes in a binary tree with height(longest path from a leaf to the root node) h is: $2^z-1$ Where $Z= h + 1$ or Z is also the number of levels in the tree.
- Balanced Binary Tree: A binary tree is balanced if the difference between the height of left and right subtree is less than equal to 1.
- Recall the definition of height of a tree, that being said, a single node tree has a height of zero. A zero node tree has a height of -1.
Implementing Binary trees:
- Using Dynamically created Linked nodes.
- Using Arrays.
Further Readings: Binary Search Trees: https://rishabhjainiitbhu.blogspot.com/2019/07/binary-search-tree-implementation-in-c.html
No comments:
Post a Comment