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