Class AbstractInOrderVisitor<T,R>

java.lang.Object
io.openml.gearbox.binarytree.traversal.AbstractVisitor<T,R>
io.openml.gearbox.binarytree.traversal.AbstractInOrderVisitor<T,R>
Type Parameters:
T - The type of value stored in the node
R - The type of object to be computed via a visiting the tree, see AbstractVisitor.getTraversalResult()
All Implemented Interfaces:
Function<TreeNode<T>,R>

@Deprecated public abstract class AbstractInOrderVisitor<T,R> extends AbstractVisitor<T,R>
Deprecated.
AbstractInOrderVisitor reflects an obsolete implementation that doesn't strictly bind the principle of Visitor pattern. Please use the enhanced TreeTraverser or AbstractInOrderTraversalVisitor
AbstractInOrderVisitor represents the notion of iteratively reading a binary tree in an in-order fashion.
  • Constructor Details

    • AbstractInOrderVisitor

      public AbstractInOrderVisitor()
      Deprecated.
  • Method Details

    • traverse

      protected R traverse(TreeNode<T> root)
      Deprecated.
      Returns inorder traversal of a binary tree.

      This method runs in O(n^2) time and O(n) space without recursion.

      Parameters:
      root - the root of the tree
      Returns:
      the inorder traversal of the tree
      Throws:
      NullPointerException - if root is null
    • apply

      public R apply(TreeNode<T> root)
      Deprecated.