Kids.Net.Au - Encyclopedia > Tarjan's off-line least common ancestors algorithm
In computer science, Tarjan's off-line least common ancestors algorithm is an algorithm based on the least common ancestor[?] property.The least common ancestor of two nodes d and e in a rooted tree T is the node g that is an ancestor of both d and e and that has the greatest depth in T.
The off-line least common ancestors problem gives us a rooted tree T and a set P = {{d,e}} of unordered pairs of nodes in T.
Tarjan's off-line least common ancestors algorithm determines the least common ancestor of each pair in P.
An example of the algorithm:
Read full article from Kids.Net.Au - Encyclopedia > Tarjan's off-line least common ancestors algorithm
No comments:
Post a Comment