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.
- emptyCase
(BiTree, Object)
- Returns an Integer object of value 0
- nonEmptyCase
(BiTree, Object)
- Recursively calculates the maximum depth of the tree
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
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