public class TarjanLowestCommonAncestor<V,E> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TarjanLowestCommonAncestor.LcaRequestResponse<V> |
Constructor and Description |
---|
TarjanLowestCommonAncestor(Graph<V,E> g)
Create an instance with a reference to the graph that we will find LCAs
for
|
Modifier and Type | Method and Description |
---|---|
List<V> |
calculate(V start,
List<TarjanLowestCommonAncestor.LcaRequestResponse<V>> lrr)
Calculate the LCMs between a set of pairs (
a and
b ) treating start as the root we want to search from,
and setting the LCA of each pair in its LCA field |
V |
calculate(V start,
V a,
V b)
Calculate the LCM between
a and b treating
start as the root we want to search from. |
Copyright © 2016. All rights reserved.