Stores first ancestor in previous block
let jump_parent = new Array ( MAXN ) ; let adj = new Array ( MAXN ) ; function addEdge ( u , v ) { adj [ u ] . push ( v ) ; adj [ v ] . push ( u ) ; } function LCANaive ( u , v ) { if ( u == v ) return u ; if ( depth [ u ] > depth [ v ] ) { let t = u ; u = v ; v = t ; } v = parent [ v ] ; return LCANaive ( u , v ) ; }