public interface BinaryTree<E> extends Tree<E>
Modifier and Type | Method and Description |
---|---|
boolean |
hasLeft(Position<E> v)
Returns whether a node has a left child.
|
boolean |
hasRight(Position<E> v)
Returns whether a node has a right child.
|
Position<E> |
left(Position<E> v)
Returns the left child of a node.
|
Position<E> |
right(Position<E> v)
Returns the right child of a node.
|
boolean hasLeft(Position<E> v) throws InvalidPositionException
InvalidPositionException
boolean hasRight(Position<E> v) throws InvalidPositionException
InvalidPositionException
Position<E> left(Position<E> v) throws InvalidPositionException, BoundaryViolationException
Position<E> right(Position<E> v) throws InvalidPositionException, BoundaryViolationException