Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

hulk_baba's blog

By hulk_baba, history, 7 years ago, In English

Hello, all. I was studying properties of the ancestors in the tree and solved a problem of finding the kth ancestor of any node in O(logK) time by pre-computing 2^jth parent of every node in O(NlogN) time. I am curious to know how can I apply this knowledge to find LCA of 2 given nodes efficiently?

  • Vote: I like it
  • 0
  • Vote: I do not like it