Class BinaryTreeTraverser<T>

    • Constructor Detail

      • BinaryTreeTraverser

        public BinaryTreeTraverser()
    • Method Detail

      • leftChild

        public abstract Optional<T> leftChild​(T root)
        Returns the left child of the specified node, or Optional.absent() if the specified node has no left child.
      • rightChild

        public abstract Optional<T> rightChild​(T root)
        Returns the right child of the specified node, or Optional.absent() if the specified node has no right child.
      • children

        public final java.lang.Iterable<T> children​(T root)
        Returns the children of this node, in left-to-right order.
        Specified by:
        children in class TreeTraverser<T>
      • inOrderTraversal

        public final FluentIterable<T> inOrderTraversal​(T root)