This note describes a very simple O(1) query time algorithm for finding level ancestors. This is basically a serial (re)-implementation of the parallel algorithm of Berkman and Vishkin (O.Berkman and U.Vishkin, Finding level-ancestors in trees, JCSS, 48, 214--230, 1994). Although the basic algorithm has preprocessing time of O(n log n), by having additional levels or using table lookup, the preprocessing time can be reduced to almost linear or linear. The table lookup algorithm can be built in O(1) parallel time with $n$ processors and can also be used to simplify the parallel algorithm of Berkman and Vishkin and make it optimal.
翻译:本文描述了一种非常简单的、查询时间为O(1)的层级祖先查找算法。该算法本质上是Berkman与Vishkin并行算法(O.Berkman and U.Vishkin, Finding level-ancestors in trees, JCSS, 48, 214--230, 1994)的串行(重新)实现。尽管基础算法的预处理时间为O(n log n),但通过增加额外层级或使用查表法,预处理时间可被降低至近似线性或线性。该查表算法可在$n$个处理器上以O(1)并行时间构建,并可用于简化Berkman与Vishkin的并行算法,使其达到最优。