Class RootToLeafPathsMaker<T>

java.lang.Object
io.openml.gearbox.binarytree.pathvisitor.AbstractRootToLeafPathVisitor<T,List<Path<T>>>
io.openml.gearbox.binarytree.pathvisitor.RootToLeafPathsMaker<T>
Type Parameters:
T - The type of value store in the node of the original tree

public class RootToLeafPathsMaker<T> extends AbstractRootToLeafPathVisitor<T,List<Path<T>>>
RootToLeafPathsMaker constructs and maintains an immutable list of root-to-leaf paths of a binary tree.

For example, all root-to-leaf paths of

      1
    /  \
   2   3
  / \   \
 4  5   6
 
are [1 -> 2 -> 4 -> x, 1 -> 2 -> 5 -> x, 1 -> 3 -> 6 -> x]

All paths are constructed in O(n * h) time and O(n) space complexity, where n is the number of nodes in the binary tree and h the height of the binary tree

  • Constructor Details

    • RootToLeafPathsMaker

      public RootToLeafPathsMaker()
  • Method Details