Overview of Trees
A quick overview of trees, its types, and some important formulas to compute the height and number of nodes in a tree.
We'll cover the following...
Binary trees
Definition: A tree where each vertex has two children at most.
Types: Perfect, Full, Complete, and Skewed
Total number of nodes:
Total number of leaf nodes:
Height:
Binary tree
Binary search trees
Definition: Every node has a value greater to all the node values in its left-subtree and has a value less than all the node values in the right-subtree. Mathematically:
...