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:
Definition. A graph G = (V,E) is comprised of a set of vertices V and a set of edges E, which is an improper subset of V x V (the Cartesian product of V with itself).
Definition. A directed graph has edges that are unidirectional. That is, an edge e is represented as the tuple (v,w), where v,w vn V. However, e cannot be simultaneously represented as the tuple (w,v). A directed graph is also called a digraph.
Definition. An undirected graph has edges that have no direction. That is, an edge e can be represented as the tuple (v,w), where v,w vn V, and as the tuple (w,v). An undirected graph is also called a undigraph.
Definition. A path in a graph G = (V,E) is a sequence of vertices v1, v2,..., vn V.
Definition. A cycle is a path in a graph that starts and ends with the same vertex.
Definition. An acyclic graph G is a graph whose paths have no cycles. If G is directed, then G is called a DAG, which is short for directed acyclic graph.
Copyright © 1998 by Mark S. Schmalz
All rights reserved, except for viewing/printing by UF faculty
or students registered for this class.