Class LowestCommonAncestorDynamicGabowSimple

java.lang.Object
com.jgalgo.alg.tree.LowestCommonAncestorDynamicGabowSimple
All Implemented Interfaces:
LowestCommonAncestorDynamic

public class LowestCommonAncestorDynamicGabowSimple extends Object implements LowestCommonAncestorDynamic
Gabow implementation for dynamic LCA data structure with \(O(\log^2 n)\) amortized time for addLeaf() operation.

The running time of this algorithm for \(m\) operations over \(n\) vertices is \(O(m + n \log^2 n)\) and it uses linear space. More specifically, the addLeaf(LowestCommonAncestorDynamic.Vertex) operation is perform in \(O(\log^2 n)\) amortized time and findLowestCommonAncestor(LowestCommonAncestorDynamic.Vertex, LowestCommonAncestorDynamic.Vertex) is perform in constant time.

This implementation is used by the better linear LCA algorithm LowestCommonAncestorDynamicGabowInts and LowestCommonAncestorDynamicGabowLongs and rarely should be used directly.

Based on the simpler data structure presented in 'Data Structures for Weighted Matching and Nearest Common Ancestors with Linking' by Harold N. Gabow (1990).

Author:
Barak Ugav