org.jgrapht.alg
Class TarjanLowestCommonAncestor<V,E>
java.lang.Object
org.jgrapht.alg.TarjanLowestCommonAncestor<V,E>
public class TarjanLowestCommonAncestor<V,E>
- extends Object
Used to calculate Tarjan's Lowest Common Ancestors Algorithm
- Author:
- Leo Crawford
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
calculate
public 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.
calculate
public 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
Copyright © 2013. All rights reserved.