Download Constant-Time LCA Retrieval

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

Hardware random number generator wikipedia , lookup

Computational complexity theory wikipedia , lookup

Network science wikipedia , lookup

Computational phylogenetics wikipedia , lookup

Signal-flow graph wikipedia , lookup

Path integral formulation wikipedia , lookup

Corecursion wikipedia , lookup

Transcript



First we calculate path(u) XOR path(v) and find
the left most bit which equals 1.
If there is no such bit than path(u) = path(v)
and so u = v, so assume that the k’th bit of the
result is 1.
If both the k’th bit in path(u) and the k’th bit in
path(v) are path bits, then this means that u
and v agree on k-1 edges of their path from
the root, meaning that the k-1 prefix of each
node’s path number encodes within it the path
from the root to lca(u,v).