Theory of Computing Systems

, Volume 37, Issue 3, pp 441–456 | Cite as

Nearest Common Ancestors: A Survey and a New Algorithm for a Distributed Environment

  • Stephen AlstrupEmail author
  • Cyril GavoilleEmail author
  • Haim KaplanEmail author
  • Theis RauheEmail author


Several papers describe linear time algorithms to preprocess a tree, in order to answer subsequent nearest common ancestor queries in constant time. Here, we survey these algorithms and related results. Whereas previous algorithms produce a linear space data structure, in this paper we address the problem of distributing the data structure into short labels associated with the nodes. Localized data structures received much attention recently as they play an important role for distributed applications such as routing. We conclude our survey with a new simple algorithm that labels in O(n) time all the nodes of an n-node rooted tree such that from the labels of any two nodes alone one can compute in constant time the label of their nearest common ancestor. The labels assigned by our algorithm are of size O(log n) bits.


Label Scheme Complete Binary Tree Lower Common Ancestor Balance Binary Tree Heavy Label 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag 2004

Authors and Affiliations

  1. 1.Department of Theory, IT University of CopenhagenCopenhagen DK-2400Denmark
  2. 2.LaBRI, Universite de Bordeaux33405 Talence cedexFrance
  3. 3.School of Computer Science, Tel Aviv UniversityTel AvivIsrael

Personalised recommendations