##
Sqrt (or Square Root) Decomposition | Set 2 (LCA of Tree in O(sqrt(height)) time)
February 7, 2017

Prerequisite : Introduction and DFS The task is to find LCA of two given nodes in a tree (not necessarily a Binary Tree). In previous posts, we have seen how to calculate LCA using Sparse Matrix DP approach. In this post, we will see an optimization done on Naive method by sqrt decomposition technique that… Read More »