@Beta @GwtCompatible(emulated=true) public abstract class BinaryTreeTraverser<T> extends TreeTraverser<T>
TreeTraverser for binary trees, providing additional traversals specific to binary trees.
| Constructor and Description |
|---|
BinaryTreeTraverser()
|
| Modifier and Type | Method and Description |
|---|---|
Iterable |
children(T root)
Returns the children of this node, in left-to-right order.
|
FluentIterable |
inOrderTraversal(T root)
|
abstract Optional |
leftChild(T root)
Returns the left child of the specified node, or
Optional if the specified node has no left child.
|
abstract Optional |
rightChild(T root)
Returns the right child of the specified node, or
Optional if the specified node has no right child.
|
breadthFirstTraversal, postOrderTraversal, preOrderTraversalpublic 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)
public final FluentIterable<T> inOrderTraversal(T root)