Class TreeMaxDepthCalculator

java.lang.Object
org.jhotdraw8.fxbase.tree.TreeMaxDepthCalculator

public class TreeMaxDepthCalculator extends Object
Computes the maximal depth of a tree.
  • Constructor Details

    • TreeMaxDepthCalculator

      public TreeMaxDepthCalculator()
  • Method Details

    • getMaxDepth

      public <T> int getMaxDepth(T root, Function<T,Iterable<T>> getChildren)
      Computes the maximal depth of the sub-tree starting at this tree node.

      References:

      Binary Tree: Maximum Depth/Height Of Deepest Node using recursive and iterative way
      dev.to
      Returns:
      the maximal depth