Calculating the maximum of MaxWeight of v to its 2 ^ i - th ancestor and MaxWeight of u to its 2 ^ i - th ancestor
maxWei = Math . Max ( maxWei , Math . Max ( maxWeight [ v , i ] , maxWeight [ u , i ] ) ) ; v = lca [ v , i ] ; u = lca [ u , i ] ; } }