infovis.tree
Class BreadthFirst

java.lang.Object
  extended by infovis.tree.BreadthFirst

public class BreadthFirst
extends Object

Breadth First traversal algorithm for trees.

Version:
$Revision: 1.9 $
Author:
Jean-Daniel Fekete

Nested Class Summary
static interface BreadthFirst.Visitor
          Class for traversing a tree breadth first.
 
Constructor Summary
BreadthFirst()
           
 
Method Summary
static void visit(Tree tree, BreadthFirst.Visitor visitor, int node)
           
static void visit(Tree tree, BreadthFirst.Visitor visitor, int node, IntStack Q)
          Traverse the tree starting at a node with a breadth first traversal, calling the visitor at each node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreadthFirst

public BreadthFirst()
Method Detail

visit

public static void visit(Tree tree,
                         BreadthFirst.Visitor visitor,
                         int node,
                         IntStack Q)
Traverse the tree starting at a node with a breadth first traversal, calling the visitor at each node.

Parameters:
tree - the Tree.
visitor - the BreadthFirst.Visitor
node - the root node.
Q - an IntVector used as a queue.

visit

public static void visit(Tree tree,
                         BreadthFirst.Visitor visitor,
                         int node)


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.