1 research outputs found

    A Simple Solution to the Level-Ancestor Problem

    Full text link
    A Level Ancestory query LA(uu, dd) asks for the the ancestor of the node uu at a depth dd. We present a simple solution, which pre-processes the tree in O(n)O(n) time with O(n)O(n) extra space, and answers the queries in $O(\log\ {n})$ time. Though other optimal algorithms exist, this is a simple enough solution that could be taught and implemented easily
    corecore