Returning the LCA of u and v Time complexity : O ( log n )
static int lca ( int u , int v ) { if ( depth [ v ] < depth [ u ] ) { u = u + v ; v = u - v ; u = u - v ; } int diff = depth [ v ] - depth [ u ] ;