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