Optimal pointer algorithms for finding nearest common ancestors in dynamic trees

被引:12
作者
Alstrup, S
Thorup, M
机构
[1] IT Univ Copenhagen, DK-2400 Copenhagen NV, Denmark
[2] AT&T Labs Res, Shannon Lab, Florham Park, NJ 07932 USA
关键词
D O I
10.1006/jagm.2000.1079
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
We consider the problem of finding the nearest common ancestor of two given nodes x and y (denoted by nca(x,y)) in a dynamic forest of rooted trees. Interspersed with nea-queries are online commands link(x, y), where x, but not necessarily y, is a tree root. The effect of a command link(x, y) is to combine the trees containing x and y, by making y the parent of x. This problem was originally proposed by A. V. Aho, J. E. Hopcroft, and J. D. Ullman (SIAM J. Comput. 5, No. 1 (1976), 115-132). We present a pointer machine algorithm, which performs n link and m nca operations in time O(n + m log log n), matching a lower bound by D. Harel and R. E. Tarjan (SIAM J. Comput. 13, No. 2 (1984), 338-355). The previous best bound on a pointer machine was O((n + m)log n), due to D. D. Sleator and R. E. Tarjan (J. Comput. System Sci. 26, No. 3 (1983), 362-391). (C) 2000 Academic Press.
引用
收藏
页码:169 / 188
页数:20
相关论文
共 16 条
[1]  
Aho A. V., 1976, SIAM Journal on Computing, V5, P115, DOI 10.1137/0205011
[2]  
Aho A.V., 1974, The Design and Analysis of Computer Algorithms
[3]  
ALSTRUP S, 1995, 9530 U COP DEP COMP
[4]  
BUCHSBAUM AL, 1998, ANN ACM S THEOR COMP, V30, P279
[5]  
COLE R, 1999, ANN ACM SIAM S DISCR, V10
[6]  
Fredman M. L., 1989, Proceedings of the Twenty First Annual ACM Symposium on Theory of Computing, P345, DOI 10.1145/73007.73040
[7]   A LINEAR-TIME ALGORITHM FOR A SPECIAL CASE OF DISJOINT SET UNION [J].
GABOW, HN ;
TARJAN, RE .
JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1985, 30 (02) :209-221
[8]  
GABOW HN, 1990, ANN ACM SIAM S DISCR, V1, P434
[9]  
GUSFIELD D, 1997, ALGORITHMS STRINGS T, P196
[10]   FAST ALGORITHMS FOR FINDING NEAREST COMMON ANCESTORS [J].
HAREL, D ;
TARJAN, RE .
SIAM JOURNAL ON COMPUTING, 1984, 13 (02) :338-355