Skip to main content

Binary Lifting & Lowest Common Ancestor (LCA)

Precompute `2^k` ancestor jumps to answer k-th ancestor and LCA queries in O(log n).

This lesson has not been built yet.