Computing LCA
compute_lca ( ) ; let queries = [ [ 3 , 5 ] , [ 2 , 3 ] , [ 2 , 4 ] ] ; let q = 3 ; for ( let i = 0 ; i < q ; i ++ ) { let max_edge = getMax ( queries [ i ] [ 0 ] , queries [ i ] [ 1 ] ) ; document . write ( max_edge + " " ) ; }