This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ) children are called the left and
There is a common diagram used for binary
trees, unlike those for more general trees. Some more examples with nodes labelled.
a z y d
f If every node of a binary tree has as many nodes
in its left subtree as it has in its right subtree, it is
called balanced. x c b g Another property which binary trees can possess
balance t Usually this means most of the higher nodes in a
tree have two children. v
This is a very desirable feature, as it reduces the
height of the tree. 2 We are going to use a binary tree to store
information (in the nodes). We started out by saying this was going to lead
to good searching and sorting methods. This information can be of any form.
Let's see it.
The tree doesn't have to be binary, but we will
The tree doesn have to be binary but we will
discuss this particular tree in the most detail.
What makes the tree interesting is the
relationship between the contents of nodes and
those of their descendants. The contents of any node
View Full Document