Concepts2
⚙️AlgorithmIntermediate
LCA - Binary Lifting
Binary lifting precomputes 2^k ancestors for every node so we can jump upward in powers of two.
#lca#binary lifting#tree+12
⚙️AlgorithmIntermediate
Lowest Common Ancestor (LCA)
The Lowest Common Ancestor (LCA) of two nodes in a rooted tree is the deepest node that is an ancestor of both.
#lowest common ancestor#binary lifting#euler tour+12