Opus5.Application2

Explanation

This application illustrates the use of a queue to implement breadth-first traversal. It uses the breadthFirstTraversal method given in Program 6.20.

The source code for the main method is available here.

Instructions

This is a non-interactive program that creates a tree and then performs a breadth-first traversal of that tree, printing the nodes as it goes.


Bruno
Copyright © 1999 by Bruno R. Preiss, P.Eng. All rights reserved.