Data.Graph.Tree.LCA
data LCA Source #
Constructors
Fields
first index in Euler Tour
Euler Tour RMQ (depth, vertex)
buildLCA :: Unbox w => SparseGraph w -> Vertex -> LCA Source #
queryLCA :: LCA -> Vertex -> Vertex -> Vertex Source #
O(1)
queryDepth :: LCA -> Vertex -> Int Source #
queryDist :: LCA -> Vertex -> Vertex -> Int Source #