Class TreeUtil



  • public class TreeUtil
    extends Object
    • Constructor Detail

      • TreeUtil

        public TreeUtil()
    • Method Detail

      • traversePreorder

        public static <T> void traversePreorder(Tree<T> tree,
                                                Visitor<T> visitor)
      • traversePreorder

        public static <T> void traversePreorder(TreeNode<T> node,
                                                Visitor<T> visitor,
                                                int depth,
                                                int index,
                                                int numSiblings)
      • traversePreorder

        public static <T> void traversePreorder(Tree<T> tree,
                                                TreeNodeVisitor<? super T> visitor)
      • traversePreorder

        public static <T> void traversePreorder(TreeNode<T> node,
                                                TreeNodeVisitor<? super T> visitor,
                                                int depth,
                                                int index,
                                                int numSiblings)
      • traversePostorder

        public static <T> void traversePostorder(Tree<T> tree,
                                                 Visitor<T> visitor)
      • traversePostorder

        public static <T> void traversePostorder(TreeNode<T> node,
                                                 Visitor<T> visitor,
                                                 int depth,
                                                 int index,
                                                 int numSiblings)
      • traversePostorder

        public static <T> void traversePostorder(Tree<T> tree,
                                                 TreeNodeVisitor<? super T> visitor)
      • traversePostorder

        public static <T> void traversePostorder(TreeNode<T> node,
                                                 TreeNodeVisitor<? super T> visitor,
                                                 int depth,
                                                 int index,
                                                 int numSiblings)
      • traverse

        public static <T> void traverse(TreeNode<T> node,
                                        PrePostVisitor<T> visitor,
                                        int depth,
                                        int index,
                                        int numSiblings)