On finding lowest common ancestors: simplification and parallelization
We consider the following problem. Suppose a rooted tree $T$ is available for preprocessing. Answer on-line queries requesting the lowest common ancestor for any pair of vertices in $T$. We present a linear time and space preprocessing algorithm that enables us to answer each query in $O(1)$ time, a...
Gespeichert in:
Veröffentlicht in: | SIAM journal on computing 1988-12, Vol.17 (6), p.1253-1262 |
---|---|
Hauptverfasser: | , |
Format: | Artikel |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | We consider the following problem. Suppose a rooted tree $T$ is available for preprocessing. Answer on-line queries requesting the lowest common ancestor for any pair of vertices in $T$. We present a linear time and space preprocessing algorithm that enables us to answer each query in $O(1)$ time, as in Harel and Tarjan [SIAM J. Comput., 13 (1984), pp. 338-355]. Our algorithm has the advantage of being simple and easily parallelizable. The resulting parallel preprocessing algorithm runs in logarithmic time using an optimal number of processors on an EREW PRAM. Each query is then answered in $O(1)$ time using a single processor. |
---|---|
ISSN: | 0097-5397 1095-7111 |
DOI: | 10.1137/0217079 |