Interface LowestCommonAncestorOffline


  • public interface LowestCommonAncestorOffline
    An algorithm for computing the lowest common ancestor (LCA) of two vertices in a tree, offline.

    Given a rooted tree, the lowest common ancestor (LCA) of two vertices u and v is the lowest vertex (farthest to root) that has both u and v as descendants. The offline version of this problem is given a tree and a set of pairs of vertices, find the LCA of each pair. There are also the static and online versions of this problem.

    Use newInstance() to get a default implementation of this interface. A builder obtained via newBuilder() may support different options to obtain different implementations.

    Author:
    Barak Ugav
    See Also:
    LowestCommonAncestorStatic, LowestCommonAncestorDynamic