Binary Lifting & Lowest Common Ancestor (LCA)
Preprocess a tree to answer ancestor and LCA queries in O(log n) using the binary lifting technique.
Found this helpful? Subscribe for new deep-dives every week.
Preprocess a tree to answer ancestor and LCA queries in O(log n) using the binary lifting technique.
Found this helpful? Subscribe for new deep-dives every week.