 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
The
distance of a node from the root
|
|
|
|
– |
determines
how efficiently it can be located
|
|
|
|
– |
the
shorter we can make the tree, the easier it is
|
|
|
to
locate any desired node in the tree
|
|
|
| • |
To
determine if a tree is balanced
|
|
|
|
– |
we
can calculate its balance factor
|
|
|
|
– |
which
is the difference in heights between its
|
|
|
|
left
and right subtrees
|
|
|
|
– |
Balance = HL - HR
|
|
|
|