dsa3 min read
Kth Ancestor of a Tree Node
Find the Kth ancestor of any tree node in O(log k) per query using binary lifting (sparse table DP).
Read →
webcoderspeed.com
1 articles
Find the Kth ancestor of any tree node in O(log k) per query using binary lifting (sparse table DP).