Constructor and Description |
---|
QuerierImpl() |
Modifier and Type | Method and Description |
---|---|
<E,N extends OpenBinaryTreeNode<E,N>> |
isBalanced(N node)
Test if the subtree starting at the node is balanced.
|
<E,N extends OpenBinaryTreeNode<E,N>> |
isPerfectlyBalanced(N node)
Test if the subtree starting at the node is perfectly balanced.
|
<E,N extends OpenNode<E,N>,R> |
partialReduce(N node,
BiFunction<N,Collection<R>,ReductionResult<R>> reducer)
Reduce the subtree starting at a node.
|
<E,N extends OpenNode<E,N>> |
pathsToLeaves(N node)
Find all the paths to leaf nodes from the provided node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
height, height, isBalanced, isPerfectlyBalanced, partialReduce, pathsToLeaves, reduce, reduce
public <E,N extends OpenNode<E,N>> SimpleCollection<List<N>> pathsToLeaves(N node)
Querier
pathsToLeaves
in interface Querier
E
- The element typeN
- The node typenode
- The starting nodepublic <E,N extends OpenBinaryTreeNode<E,N>> boolean isBalanced(N node)
Querier
isBalanced
in interface Querier
E
- The element typeN
- The node typenode
- The node to testpublic <E,N extends OpenBinaryTreeNode<E,N>> boolean isPerfectlyBalanced(N node)
Querier
isPerfectlyBalanced
in interface Querier
E
- The element typeN
- The node typenode
- The node to testpublic <E,N extends OpenNode<E,N>,R> R partialReduce(N node, BiFunction<N,Collection<R>,ReductionResult<R>> reducer)
Querier
partialReduce
in interface Querier
E
- The element typeN
- The node typeR
- The type of resultnode
- The node to start the reduction atreducer
- The reducer to applyCopyright © 2014–2016. All rights reserved.