Uses of Interface
io.openml.gearbox.binarytree.TreeNode
Packages that use TreeNode
Package
Description
-
Uses of TreeNode in io.openml.gearbox.binarytree
Classes in io.openml.gearbox.binarytree that implement TreeNodeModifier and TypeClassDescriptionfinal class
ImmutableTreeNode
encapsulates the value, left tree reference, and right tree reference in an immutable state; it also represents a concrete 'Element', i.e.final class
MutableTreeNode
saves the memory footprint ofTreeNode
and is suitable for the performance intensive application.Methods in io.openml.gearbox.binarytree that return TreeNodeModifier and TypeMethodDescriptionBinaryTreeSerde.deserialize
(String string, Function<String, T> deserializer) Deserializes a binary tree in string representation.static <T> TreeNode<T>
ImmutableTreeNode.emptyNode()
Creates a dummy node withnull
value,null
left subtree, andnull
right subtree.static <T> TreeNode<T>
MutableTreeNode.emptyNode()
Creates a dummy node withnull
value,null
left subtree, andnull
right subtree.ImmutableTreeNode.getLeft()
MutableTreeNode.getLeft()
TreeNode.getLeft()
Returns the reference to the left child of this tree node.ImmutableTreeNode.getRight()
MutableTreeNode.getRight()
TreeNode.getRight()
Returns the reference to the right child of this tree node.static <T> TreeNode<T>
BinaryTree.getRightMostNode
(TreeNode<T> root) Returns the right most leaf of a binary tree.static <T> TreeNode<T>
BinaryTree.invertTree
(TreeNode<T> root) Inverts a binary tree.static <T> TreeNode<T>
BinaryTree.mergeTrees
(TreeNode<T> first, TreeNode<T> second, BiFunction<T, T, T> valueAdder) Merges two binary trees and returns the root of the new tree.static <T> TreeNode<T>
BinaryTree.subtreeWithAllDeepest
(TreeNode<T> root) Returns the binary tree node with the largest depth such that it contains all the deepest nodes in its subtree.static <T> TreeNode<T>
ImmutableTreeNode.value
(T value) Creates a newTreeNode
with the specified node value.static <T> TreeNode<T>
MutableTreeNode.value
(T value) Creates a newTreeNode
with the specified node value.static <T> TreeNode<T>
ImmutableTreeNode.valueWithLeft
(T value, TreeNode<T> left) Creates a newTreeNode
with the specified node value and a left subtree.static <T> TreeNode<T>
ImmutableTreeNode.valueWithLeftAndRight
(T value, TreeNode<T> left, TreeNode<T> right) Private all-args constructor that is to be shared across all static factor methods.static <T> TreeNode<T>
ImmutableTreeNode.valueWithRight
(T value, TreeNode<T> right) Creates a newTreeNode
with the specified node value and a right subtree.Returns a same instance with a specified new left child.Returns a same instance with a specified new left child.Returns a same instance with a specified new right child.Returns a same instance with a specified new right child.Methods in io.openml.gearbox.binarytree that return types with arguments of type TreeNodeModifier and TypeMethodDescriptionBinaryTree.findDuplicateSubtrees
(TreeNode<T> root, Function<T, String> serializer) Return all duplicate subtrees in a binary tree.BinaryTree.generateBst
(int max) Returns all structurally unique binary search trees that store values 1 ...Returns an immutable list of all neighbors to which the specifiedTreeNode
key is mapped, orCollections.emptyList()
if thisTreeGraph
map contains no mapping for the key.TreeGraph.keySet()
Returns an immutableSet
view of the all nodes of the original tree.BinaryTree.pathCondition
(TreeNode<T> root, Predicate<List<TreeNode<T>>> condition) Returns all root-to-leaf paths of a binary tree where each path satisfies a given condition.Methods in io.openml.gearbox.binarytree with parameters of type TreeNodeModifier and TypeMethodDescriptionstatic <T,
R> boolean BinaryTree.checkEqualTree
(TreeNode<T> root, Function<TreeNode<T>, R> computeProperty) Returnstrue
if it is possible to partition a binary tree to two trees such that both have the same specified property after removing exactly one edge from the original tree.BinaryTree.findDuplicateSubtrees
(TreeNode<T> root, Function<T, String> serializer) Return all duplicate subtrees in a binary tree.Returns an immutable list of all neighbors to which the specifiedTreeNode
key is mapped, orCollections.emptyList()
if thisTreeGraph
map contains no mapping for the key.static <T> TreeNode<T>
BinaryTree.getRightMostNode
(TreeNode<T> root) Returns the right most leaf of a binary tree.static <T> TreeNode<T>
BinaryTree.invertTree
(TreeNode<T> root) Inverts a binary tree.static <T> int
BinaryTree.largestBstSubtree
(TreeNode<T> root, Comparator<T> comparator) Returns the size of the largest BST in a binary tree.static <T> int
BinaryTree.longestConsecutive
(TreeNode<T> root, BiPredicate<T, T> isConsecutive) Returns the length of the longest consecutive sequence path of a binary tree.static <T> int
BinaryTree.longestConsecutiveNodeToNode
(TreeNode<T> root, BiPredicate<T, T> isConsecutive) Returns the length of the longest consecutive sequence node-to-node path of a binary tree.static <T> TreeNode<T>
BinaryTree.mergeTrees
(TreeNode<T> first, TreeNode<T> second, BiFunction<T, T, T> valueAdder) Merges two binary trees and returns the root of the new tree.static <T> TreeGraph<T>
Creates the map view of a specified tree.BinaryTree.pathCondition
(TreeNode<T> root, Predicate<List<TreeNode<T>>> condition) Returns all root-to-leaf paths of a binary tree where each path satisfies a given condition.protected abstract void
AbstractInOrderTraversalVisitor.processNode
(TreeNode<T> node) An abstract method that defines the "visit" operation to be performed on each node during the traversal.protected abstract void
AbstractPostOrderTraversalVisitor.processNode
(TreeNode<T> node) An abstract method that defines the operation to be performed on each node during the traversal.protected abstract void
AbstractPreOrderTraversalVisitor.processNode
(TreeNode<T> node) An abstract method that defines the operation to be performed on each node during the traversal.static <T> void
BinaryTree.recoverTree
(TreeNode<T> root, Comparator<T> comparator) Recover a binary search tree whose 2 elements are out of order.Returns a string representation of a binary tree by serializing eachnode value
using the defaultObjects.toString(Object)
.Returns a string representation of a binary tree by serializing eachnode value
using a specified strategy.void
Mutates the left child of this node with a specified left subtree.void
Mutates the right child of this node with a specified lrighteft subtree.static <T> TreeNode<T>
BinaryTree.subtreeWithAllDeepest
(TreeNode<T> root) Returns the binary tree node with the largest depth such that it contains all the deepest nodes in its subtree.void
TreeTraverser.traverseInOrder
(TreeNode<T> root, Visitor<T> visitor) Performs an iterative in-order traversal of the tree structure.void
TreeTraverser.traversePostOrder
(TreeNode<T> root, Visitor<T> visitor) Performs an iterative post-order traversal (Left, Right, Root).void
TreeTraverser.traversePreOrder
(TreeNode<T> root, Visitor<T> visitor) Performs an iterative pre-order traversal (Root, Left, Right).static <T> TreeNode<T>
ImmutableTreeNode.valueWithLeft
(T value, TreeNode<T> left) Creates a newTreeNode
with the specified node value and a left subtree.static <T> TreeNode<T>
ImmutableTreeNode.valueWithLeftAndRight
(T value, TreeNode<T> left, TreeNode<T> right) Private all-args constructor that is to be shared across all static factor methods.static <T> TreeNode<T>
ImmutableTreeNode.valueWithRight
(T value, TreeNode<T> right) Creates a newTreeNode
with the specified node value and a right subtree.Returns a same instance with a specified new left child.Returns a same instance with a specified new left child.Returns a same instance with a specified new right child.Returns a same instance with a specified new right child.Method parameters in io.openml.gearbox.binarytree with type arguments of type TreeNodeModifier and TypeMethodDescriptionstatic <T,
R> boolean BinaryTree.checkEqualTree
(TreeNode<T> root, Function<TreeNode<T>, R> computeProperty) Returnstrue
if it is possible to partition a binary tree to two trees such that both have the same specified property after removing exactly one edge from the original tree.BinaryTree.pathCondition
(TreeNode<T> root, Predicate<List<TreeNode<T>>> condition) Returns all root-to-leaf paths of a binary tree where each path satisfies a given condition. -
Uses of TreeNode in io.openml.gearbox.binarytree.pathvisitor
Methods in io.openml.gearbox.binarytree.pathvisitor that return TreeNodeModifier and TypeMethodDescriptionPath.getLast()
Returns the tail of this path.Path.removeLast()
Deletes the tail of this path.Methods in io.openml.gearbox.binarytree.pathvisitor that return types with arguments of type TreeNodeModifier and TypeMethodDescriptionPath.view()
Returns an immutable view of all path elements in thisPath
at the time of calling this method.Methods in io.openml.gearbox.binarytree.pathvisitor with parameters of type TreeNodeModifier and TypeMethodDescriptionvoid
Appends aTreeNode
to the end of this path.static <T> RootToLeafPathsMaker<T>
RootToLeafPathsMaker.constructFor
(TreeNode<T> root) Constructs all root-to-leaf paths of a specified binary tree.protected void
RootToLeafPathsMaker.constructTreePaths
(TreeNode<T> root, Path<T> path) Deprecated.recursion is inefficient on large treestatic <T> DepthCalculator<T>
Takes the root of a binary tree and calculates the depth of the tree rooted at that node.void
Keeps removingTreeNode
elements from end of an under-construction path (last, 2nd last, 3rd last ...) until the element to be removed equals to a specified element.protected void
Executes the path-traversal algorithm on a specified binary tree. -
Uses of TreeNode in io.openml.gearbox.binarytree.traversal
Methods in io.openml.gearbox.binarytree.traversal that return types with arguments of type TreeNodeModifier and TypeMethodDescriptionDeprecated.Searches for a node with a target value in a binary tree and returns that node.PreOrderSearch.forValue
(T target) Deprecated.Creates a search instance for a specifiedtree node value
.PreOrderSearch.forValue
(T target) Deprecated.Creates a search instance for a specifiedtree node value
.PreOrderSearch.getTraversalResult()
Deprecated.Methods in io.openml.gearbox.binarytree.traversal with parameters of type TreeNodeModifier and TypeMethodDescriptionDeprecated.Deprecated.Deprecated.Deprecated.Searches for a node with a target value in a binary tree and returns that node.static <T> Long
Deprecated.One-time computes the size of a specified binary tree.protected R
Deprecated.Returns inorder traversal of a binary tree.protected R
Deprecated.Returns inorder traversal of a binary tree.protected R
Deprecated.Pre-order traverses the specified tree and performs actions on each visited node.protected abstract void
Deprecated.Performs actions on each visited node during traversal.protected void
Deprecated.protected void
Deprecated.