A Simple Solution to the Level-Ancestor Problem

Abstract

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

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…