mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
@ -3,7 +3,7 @@
|
||||
* Binary Lifting implementation in Javascript
|
||||
* Binary Lifting is a technique that is used to find the kth ancestor of a node in a rooted tree with N nodes
|
||||
* The technique requires preprocessing the tree in O(N log N) using dynamic programming
|
||||
* The techniqe can answer Q queries about kth ancestor of any node in O(Q log N)
|
||||
* The technique can answer Q queries about kth ancestor of any node in O(Q log N)
|
||||
* It is faster than the naive algorithm that answers Q queries with complexity O(Q K)
|
||||
* It can be used to find Lowest Common Ancestor of two nodes in O(log N)
|
||||
* Tutorial on Binary Lifting: https://codeforces.com/blog/entry/100826
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Author: Adrito Mukherjee
|
||||
* Findind Lowest Common Ancestor By Binary Lifting implementation in JavaScript
|
||||
* Finding Lowest Common Ancestor By Binary Lifting implementation in JavaScript
|
||||
* The technique requires preprocessing the tree in O(N log N) using dynamic programming)
|
||||
* It can be used to find Lowest Common Ancestor of two nodes in O(log N)
|
||||
* Tutorial on Lowest Common Ancestor: https://www.geeksforgeeks.org/lca-in-a-tree-using-binary-lifting-technique
|
||||
|
Reference in New Issue
Block a user