Advertisement

Acta Informatica

, Volume 25, Issue 1, pp 37–54 | Cite as

The nearest common ancestor in a dynamic tree

  • Athanasios K. Tsakalidis
Article

Summary

We consider the problem of determining the nearest common ancestor of two given nodes x and y (denoted by nca(x, y)) in a dynamic arbitrary tree T. We present an implementation of T by a pointer machine which needs linear space, performs m arbitrary insertions and deletions in the initially empty tree T in time O(m) and a query about nca(x, y) can be answered on-line in time O(log(min{depth(x), depth(y))+α(k,k))}, where the second factor is amortized over k queries, α is a functional inverse of Ackermann's function and depth(x) the distance from node x to the root of T.

Keywords

Common Ancestor Search Path Dynamic Tree Main Representative Random Access Machine 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms. Reading, MA: Addison-Wesley, 1974zbMATHGoogle Scholar
  2. 2.
    Aho, A., Hopcroft, J., Ullman, J.: On finding Lowest Common Ancestors in Trees. SIAM J. Comput. Vol 1, 115–132 (1976)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Harel, D.: A Linear Time Algorithm for the Lowest Common Ancestors problem. Proc. 21st IEEE Symposium on Foundations of Computer Science, pp. 308–319 (1980)Google Scholar
  4. 4.
    Harel, D., Tarjan, R.E.: Fast Algorithms for finding Nearest Common Ancestors. SIAM J. Comput. 13, 338–355 (1984)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Reference deletedGoogle Scholar
  6. 6.
    Maier, D.: An Efficient Method for storing Ancestor Information in Trees. SIAM J. Comput. 8, 599–618 (1979)MathSciNetzbMATHCrossRefGoogle Scholar
  7. 7.
    Schieber, B., Viskin, U.: On Finding Lowest Common Ancestors: Simplification and Parallelization. Technical Report 63/87, NY University, New York, (1987)Google Scholar
  8. 8.
    Sleator, D., Tarjan, R.E.: A Data Strucutre for Dynamic Trees, J. Comput. System Sci. 26, 362–391 (1983)MathSciNetzbMATHCrossRefGoogle Scholar
  9. 9.
    Tarjan, R.E.: A Class of Algorithms which require non-linear time to maintain Disjoint Sets. J. Comput. System Sci. 18, 110–127 (1979)MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Tarjan, R.E., v. Leeuwen, J.: Worst-Case Analysis of Set Union Algorithms. Journal of ACM, 31, 245–281 (1984)zbMATHCrossRefGoogle Scholar
  11. 11.
    Tsakalidis, A.K.: Maintaining Order in a Generalized Linked List. Acta Informatica 21, 101–112 (1984)MathSciNetzbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag 1988

Authors and Affiliations

  • Athanasios K. Tsakalidis
    • 1
  1. 1.Computer Technology InstitutePatrasGreece

Personalised recommendations