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 = 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:
  TOLCA(u) {  Make-set(u);  ancestorFind-Set(u) <- u;  for each child v in u in T    do { TOLCA(v);         Union(u,v);         ancestorFind-Set(u) <- u;       }  colouru <- black;  for each node v such that {u,v} in P    do if (colourv = black) {       print "Tarjan's Least Common Ancestor of" + u +             " and " + v + " is " ancestorFind-Set(v);       }  } 
The following procedure assumes each node is white before coloured black.

 

<< PreviousWord BrowserNext >>
treknobabble
king's highway (st. augustine to mexico)
jody scheckter
aaas
kamchadal
separation anxiety disorder
moshe katsav
nivkh
american association for the advancement of science
halloween iii: season of the witch
john fitzwilliam stairs
sanctuary (band)
three forms of mathematical induction
bank one ballpark
the murder of roger ackroyd
gerald merrithew
fai
malic acid
the a.b.c. murders
optimal substructure
spectral method
johann georg hamann
hess's law
samuel roxy rothafel
roy ridley
caligula (film)
lucius valerius potitus
marcus valerius corvus
southwest conference
antonio sanchez
homogeneous co ordinates
afghanistan timeline june 2003
ktm
oculomotor nerve
afghanistan timeline july 2003
trochlear nerve
trigeminal nerve
vestibulocochlear nerve
glossopharyngeal nerve
whole product
accessory nerve
hypoglossal nerve
green's theorem
george green