Data Structures: § 3: Graphs and Trees

Instructor: M.S. Schmalz


After having discussed linear structures such as lists and stacks, we investigated the tree-structured heap. This should lead you to ask whether or not other tree-structured ADTs exist, and what are their uses. In this section, we examine tree-structured ADTs and summarize their various advantages and disadvantages, together with ADT operations specific to these structures. This section is organized as follows:

We begin with a discussion of theory of graphs and trees, as follows.

3.1. Mathematics of Graphs and Trees

It is often desirable to characterize relationships among data in a hierarchical fashion. This type of representation is facilitated by the tree data structure. A tree can be thought of like the geneaological trees that people use to trace their ancestors. Each internal node has one or more children, and there is often a top-level node that is the ancestor of all other nodes, which is called the root of the tree. At the bottom of the tree are the leaves. These correspond in genealogical terms to people who have not yet had children of their own.


Copyright © 1998 by Mark S. Schmalz
All rights reserved, except for viewing/printing by UF faculty or students registered for this class.