cp-geeks-adgitm / Hacktoberfest

Everyone is free to contribute. Not eligible for Hacktoberfest
GNU General Public License v3.0
32 stars 95 forks source link

Company Queries 2 CSES #272

Closed 18o3 closed 1 year ago

18o3 commented 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.

18o3 commented 1 year ago

This is a Hacktoberfest PR so can you please add the "HACKTOBERFEST-ACCEPTED LABEL" if you merge my pull request . Thank You