Class brsVisitor.BRSGetMaxDepthVisitor


public class BRSGetMaxDepthVisitor
extends Object
implements IVisitor
This IBRSAlgo will find the maximum depth of a BiTree. The depth of an empty tree is zero. The depth of a single element tree is one.


Method Index

 o emptyCase (BiTree, Object)
Returns an Integer object of value 0
 o nonEmptyCase (BiTree, Object)
Recursively calculates the maximum depth of the tree

Methods

 o emptyCase
public Object emptyCase(BiTree host, Object input)
Returns an Integer object of value 0

Parameters:
host - The BiTree host
param - not used.
Returns:
Integer(0) always
 o nonEmptyCase
public final Object nonEmptyCase(BiTree host, Object input)
Recursively calculates the maximum depth of the tree.

Parameters:
host - The BiTree host
param - not used.
Returns:
An Integer object