DDSA Solutions

Binary Lifting

1 problems

Binary lifting precomputes 2ᵏ-th ancestors for each node in O(n log n). LCA (lowest common ancestor) queries then run in O(log n). Useful in competitive programming for tree path queries and jumping k-steps efficiently.