Data Structures and Algorithms
with Object-Oriented Design Patterns in JavaThis section presents several graph algorithms that are based on graph traversals. The first two algorithms test undirected and directed graphs for connectedness. Both algorithms are implemented using the depth-first traversal. The third algorithm tests a directed graph for cycles. It is implemented using a topological-order traversal.
Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.