Paper record
W2004116976On Finding Lowest Common Ancestors in Trees
Alfred V. Aho, John E. Hopcroft, Jeffrey David Ullman
- Year
- 1976
- Venue
- SIAM Journal on Computing
- References
- 12
- Cited by
- 124
Details and counts from OpenAlex.
Abstract
Trees in an n-node forest are merged according to instructions in a given sequence, while other instructions in the sequence ask for the lowest common ancestor of pairs of nodes. We show that any sequence of such instructions can be processed “on-line” in steps on a random access computer. If we can accept our answer “off-line”, that is, no answers need to be produced until the entire sequence of instructions has been seen, then we may perform the task in steps, where is the very slowly growing inverse Ackermann function defined in [14]. A third algorithm solves a problem of intermediate complexity. We require the answers on-line, but we assume that all tree merging instructions precede the information requests. This algorithm requires time. We apply the first on-line algorithm to a problem in code optimization, that of computing immediate dominators in a reducible flow graph. We show how this computation can be performed in steps.