Skip to main content
Log in

The nearest common ancestor in a dynamic tree

  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms. Reading, MA: Addison-Wesley, 1974

    MATH  Google Scholar 

  2. Aho, A., Hopcroft, J., Ullman, J.: On finding Lowest Common Ancestors in Trees. SIAM J. Comput. Vol 1, 115–132 (1976)

    Article  MathSciNet  Google Scholar 

  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)

  4. Harel, D., Tarjan, R.E.: Fast Algorithms for finding Nearest Common Ancestors. SIAM J. Comput. 13, 338–355 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  5. Reference deleted

  6. Maier, D.: An Efficient Method for storing Ancestor Information in Trees. SIAM J. Comput. 8, 599–618 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  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. Sleator, D., Tarjan, R.E.: A Data Strucutre for Dynamic Trees, J. Comput. System Sci. 26, 362–391 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  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)

    Article  MathSciNet  MATH  Google Scholar 

  10. Tarjan, R.E., v. Leeuwen, J.: Worst-Case Analysis of Set Union Algorithms. Journal of ACM, 31, 245–281 (1984)

    Article  MATH  Google Scholar 

  11. Tsakalidis, A.K.: Maintaining Order in a Generalized Linked List. Acta Informatica 21, 101–112 (1984)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Tsakalidis, A.K. The nearest common ancestor in a dynamic tree. Acta Informatica 25, 37–54 (1988). https://doi.org/10.1007/BF00268844

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00268844

Keywords

Navigation