| Interactive Data Structure
Visualizations Categorizing Binary Trees |
If you have studied the previous segments on binary trees, you realize that there are many different categories of binary trees. This segment will ensure that you understand these definitions and can identify the various categories of binary trees, which include complete trees, full trees, binary search trees, heaps, and AVL trees.
To verify that a tree is not complete or full, it is necessary to identify at least one missing node.
The requirement for being a binary search tree involves the relationship between the value in each node compared to all the nodes in both its subtrees. The lowest subtrees that violate the property are illustrated by highlighting their roots. All subtrees above any such subtrees are also not binary search trees, but only the lowest subtrees are highlighted.
The definition of a heap involves the relationship between the value in each node and the values in its siblings. When a tree is not a heap, the branch that connects a node with one of its children that violates the definition is shown in white.
To determine that a tree is not an AVL tree, it is necessary to determine that it is unbalanced or to determine that it is not a binary search tree.