← all tags

Tag: binary-lifting

1 post

LCA and Binary Lifting
DSA How to jump up a tree in powers of two — kth ancestors, lowest common ancestors, and path distances, all in O(log n) per query.