Traverser
instead. All instance methods except
for inOrderTraversal(T)
have their equivalent on the result of Traverser.forTree(tree)
where tree
implements SuccessorsFunction
, which has
a similar API as children(T)
.
This class is scheduled to be removed in January 2018.
@Deprecated @Beta @GwtCompatible public abstract class BinaryTreeTraverser<T> extends TreeTraverser<T>
TreeTraverser
for binary trees, providing additional traversals specific to
binary trees.Constructor and Description |
---|
BinaryTreeTraverser()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Iterable<T> |
children(T root)
Deprecated.
Returns the children of this node, in left-to-right order.
|
FluentIterable<T> |
inOrderTraversal(T root)
Deprecated.
|
abstract Optional<T> |
leftChild(T root)
Deprecated.
Returns the left child of the specified node, or
Optional.absent() if the specified
node has no left child. |
abstract Optional<T> |
rightChild(T root)
Deprecated.
Returns the right child of the specified node, or
Optional.absent() if the specified
node has no right child. |
breadthFirstTraversal, postOrderTraversal, preOrderTraversal, using
public BinaryTreeTraverser()
public abstract Optional<T> leftChild(T root)
Optional.absent()
if the specified
node has no left child.public abstract Optional<T> rightChild(T root)
Optional.absent()
if the specified
node has no right child.public final Iterable<T> children(T root)
children
in class TreeTraverser<T>
public final FluentIterable<T> inOrderTraversal(T root)
Copyright © 2010–2017. All rights reserved.