The nearest common ancestor in a dynamic tree (Q1821561)
From MaRDI portal
scientific article
Language | Label | Description | Also known as |
---|---|---|---|
English | The nearest common ancestor in a dynamic tree |
scientific article |
Statements
The nearest common ancestor in a dynamic tree (English)
0 references
1988
0 references
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)\})+\alpha (k,k))\), where the second factor is amortized over k queries, \(\alpha\) is a functional inverse of Ackermann's function and depth(x) the distance from node x to the root of T.
0 references
dynamic tree
0 references
nearest common ancestor
0 references
pointer machine
0 references