* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Download Constant-Time LCA Retrieval
Survey
Document related concepts
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).