Algorithm
Development Kit 1.0

algs.model.tree.debug
Class BinaryTreeDebugger

java.lang.Object
  extended by algs.debug.DottyDebugger
      extended by algs.model.tree.debug.BinaryTreeDebugger
All Implemented Interfaces:
IDebugSearch, IBalancedVisitor, IVisitor

public class BinaryTreeDebugger
extends DottyDebugger
implements IVisitor, IBalancedVisitor

Debugging subclass for binary trees.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Field Summary
 
Fields inherited from class algs.debug.DottyDebugger
_ctr, BreadthFirstOrdering, defaultFontName, defaultFontSize, DepthFirstOrdering, discarded, edges, goal, nodes, start, TooLarge, unexplored
 
Constructor Summary
BinaryTreeDebugger()
           
 
Method Summary
 java.lang.String edgeType()
          Default to having nodes with complex record shapes.
 void visit(BalancedBinaryNode parent, BalancedBinaryNode n)
          Visit a node, and keep in mind its parent.
 void visit(BinaryNode parent, BinaryNode n)
          Visit (parent, child) pair by visiting both nodes, then add the edge.
 
Methods inherited from class algs.debug.DottyDebugger
complete, getInputString, getKey, labelEdge, markDiscarded, markEdge, markGoal, markStart, markUnexplored, nodeType, numNodes, ordering, rank, visitEdge, visitEdge, visitNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryTreeDebugger

public BinaryTreeDebugger()
Method Detail

edgeType

public java.lang.String edgeType()
Default to having nodes with complex record shapes. Subclasses should override as needed.

Overrides:
edgeType in class DottyDebugger

visit

public void visit(BinaryNode parent,
                  BinaryNode n)
Visit (parent, child) pair by visiting both nodes, then add the edge.

Specified by:
visit in interface IVisitor
Parameters:
parent - parent (or null if root) of node being visited.
n - node being visited

visit

public void visit(BalancedBinaryNode parent,
                  BalancedBinaryNode n)
Description copied from interface: IBalancedVisitor
Visit a node, and keep in mind its parent.

Specified by:
visit in interface IBalancedVisitor
Parameters:
parent - parent (or null if root) of node being visited.
n - node being visited

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.