Closed 18o3 closed 1 year ago
Found the Lowest Common Ancestor(LCA) of given two nodes in O(logN) time complexity per query with O(NlogN) preprocessing. Can be optimized to O(1) per query using sparse table.
This is a Hacktoberfest PR so can you please add the "HACKTOBERFEST-ACCEPTED LABEL" if you merge my pull request . Thank You
Found the Lowest Common Ancestor(LCA) of given two nodes in O(logN) time complexity per query with O(NlogN) preprocessing. Can be optimized to O(1) per query using sparse table.