V
- vertex the graph vertex typepublic interface LowestCommonAncestorAlgorithm<V>
Modifier and Type | Method and Description |
---|---|
default List<V> |
getBatchLCA(List<Pair<V,V>> queries)
Return a list of LCAs for a batch of queries
|
default List<Set<V>> |
getBatchLCASet(List<Pair<V,V>> queries)
Return a list of computed sets of LCAs for a batch of queries
|
V |
getLCA(V a,
V b)
Return the LCA of a and b
|
Set<V> |
getLCASet(V a,
V b)
Return the computed set of LCAs of a and b
|
V getLCA(V a, V b)
a
- the first element to find LCA forb
- the other element to find the LCA fordefault List<V> getBatchLCA(List<Pair<V,V>> queries)
queries
- a list of pairs of verticesSet<V> getLCASet(V a, V b)
a
- the first element to find LCA forb
- the other element to find the LCA forUnsupportedOperationException
- - if the operation is not supported by the implementing
classCopyright © 2018. All rights reserved.