Lowest Common Ancestor — Binary Lifting
equalize depth · then climb in 2
k
jumps until just below the LCA
Pick two nodes and click
Find LCA(u, v)
.
Nodes:
0
LOG:
0
u:
-
v:
-
Step:
0
Jumps:
0
LCA:
-
node u
node v
comparing 2^k anc.
jump path
LCA
Binary Lifting Table
up[k][v] = 2
k
-th ancestor (root's parent = itself)
Query Log