Initialising lca values with - 1 Initialising MinWeight values with INT_MAX Initialising MaxWeight values with INT_MIN
for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 0 ; j < log ; j ++ ) { lca [ i ] [ j ] = -1 ; minWeight [ i ] [ j ] = INT_MAX ; maxWeight [ i ] [ j ] = INT_MIN ; } }