Uses of Interface
io.openml.gearbox.algorithms.binarytree.TreeNode
Packages that use TreeNode
Package
Description
-
Uses of TreeNode in io.openml.gearbox.algorithms.binarytree
Classes in io.openml.gearbox.algorithms.binarytree that implement TreeNodeModifier and TypeClassDescriptionfinal classImmutableTreeNodeencapsulates the value, left tree reference, and right tree reference in an immutable state; it also represents a concrete 'Element', i.e.final classMutableTreeNodesaves the memory footprint ofTreeNodeand is suitable for the performance intensive application.Methods in io.openml.gearbox.algorithms.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 withnullvalue,nullleft subtree, andnullright subtree.static <T> TreeNode<T> MutableTreeNode.emptyNode()Creates a dummy node withnullvalue,nullleft subtree, andnullright 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 newTreeNodewith the specified node value.static <T> TreeNode<T> MutableTreeNode.value(T value) Creates a newTreeNodewith the specified node value.static <T> TreeNode<T> ImmutableTreeNode.valueWithLeft(T value, TreeNode<T> left) Creates a newTreeNodewith the specified node value and a left subtree.static <T> TreeNode<T> MutableTreeNode.valueWithLeft(T value, TreeNode<T> left) Creates a newTreeNodewith the specified node value and a left subtree.static <T> TreeNode<T> ImmutableTreeNode.valueWithLeftAndRight(T value, TreeNode<T> left, TreeNode<T> right) Creates a newTreeNodewith the specified node value, a left subtree, and a right subtree.static <T> TreeNode<T> MutableTreeNode.valueWithLeftAndRight(T value, TreeNode<T> left, TreeNode<T> right) Creates a newTreeNodewith the specified node value, a left subtree, and a right subtree.static <T> TreeNode<T> ImmutableTreeNode.valueWithRight(T value, TreeNode<T> right) Creates a newTreeNodewith the specified node value and a right subtree.static <T> TreeNode<T> MutableTreeNode.valueWithRight(T value, TreeNode<T> right) Creates a newTreeNodewith 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.algorithms.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 specifiedTreeNodekey is mapped, orCollections.emptyList()if thisTreeGraphmap contains no mapping for the key.TreeGraph.keySet()Returns an immutableSetview 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.algorithms.binarytree with parameters of type TreeNodeModifier and TypeMethodDescriptionstatic <T,R> boolean BinaryTree.checkEqualTree(TreeNode<T> root, Function<TreeNode<T>, R> computeProperty) Returnstrueif 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 specifiedTreeNodekey is mapped, orCollections.emptyList()if thisTreeGraphmap 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> intBinaryTree.largestBstSubtree(TreeNode<T> root, Comparator<T> comparator) Returns the size of the largest BST in a binary tree.static <T> intBinaryTree.longestConsecutive(TreeNode<T> root, BiPredicate<T, T> isConsecutive) Returns the length of the longest consecutive sequence path of a binary tree.static <T> intBinaryTree.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 voidAbstractInOrderTraversalVisitor.processNode(TreeNode<T> node) An abstract method that defines the "visit" operation to be performed on each node during the traversal.protected abstract voidAbstractPostOrderTraversalVisitor.processNode(TreeNode<T> node) An abstract method that defines the operation to be performed on each node during the traversal.protected abstract voidAbstractPreOrderTraversalVisitor.processNode(TreeNode<T> node) An abstract method that defines the operation to be performed on each node during the traversal.static <T> voidBinaryTree.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 valueusing the defaultObjects.toString(Object).Returns a string representation of a binary tree by serializing eachnode valueusing a specified strategy.voidMutates the left child of this node with a specified left subtree.voidMutates 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.voidTreeTraverser.traverseInOrder(TreeNode<T> root, Visitor<T> visitor) Performs an iterative in-order traversal of the tree structure.voidTreeTraverser.traversePostOrder(TreeNode<T> root, Visitor<T> visitor) Performs an iterative post-order traversal (Left, Right, Root).voidTreeTraverser.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 newTreeNodewith the specified node value and a left subtree.static <T> TreeNode<T> MutableTreeNode.valueWithLeft(T value, TreeNode<T> left) Creates a newTreeNodewith the specified node value and a left subtree.static <T> TreeNode<T> ImmutableTreeNode.valueWithLeftAndRight(T value, TreeNode<T> left, TreeNode<T> right) Creates a newTreeNodewith the specified node value, a left subtree, and a right subtree.static <T> TreeNode<T> MutableTreeNode.valueWithLeftAndRight(T value, TreeNode<T> left, TreeNode<T> right) Creates a newTreeNodewith the specified node value, a left subtree, and a right subtree.static <T> TreeNode<T> ImmutableTreeNode.valueWithRight(T value, TreeNode<T> right) Creates a newTreeNodewith the specified node value and a right subtree.static <T> TreeNode<T> MutableTreeNode.valueWithRight(T value, TreeNode<T> right) Creates a newTreeNodewith 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.algorithms.binarytree with type arguments of type TreeNodeModifier and TypeMethodDescriptionstatic <T,R> boolean BinaryTree.checkEqualTree(TreeNode<T> root, Function<TreeNode<T>, R> computeProperty) Returnstrueif 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.algorithms.binarytree.pathvisitor
Methods in io.openml.gearbox.algorithms.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.algorithms.binarytree.pathvisitor that return types with arguments of type TreeNodeModifier and TypeMethodDescriptionPath.view()Returns an immutable view of all path elements in thisPathat the time of calling this method.Methods in io.openml.gearbox.algorithms.binarytree.pathvisitor with parameters of type TreeNodeModifier and TypeMethodDescriptionvoidAppends aTreeNodeto 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 voidRootToLeafPathsMaker.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.voidKeeps removingTreeNodeelements from end of an under-construction path (last, 2nd last, 3rd last ...) until the element to be removed equals to a specified element.protected voidExecutes the path-traversal algorithm on a specified binary tree.