Sparse Matrix DP approach to find LCA of two nodes
using System ; using System . Collections . Generic ; class GFG { static readonly int MAXN = 100000 ; static readonly int level = 18 ; static List < int > [ ] tree = new List < int > [ MAXN ] ; static int [ ] depth = new int [ MAXN ] ; static int [ , ] parent = new int [ MAXN , level ] ;