Here we are directly taking height = 4 according to the given tree but we can pre - calculate height = max depth in one more dfs
let height = 4 ; preprocess ( height ) ; document . write ( " " + LCASQRT ( 11 , 8 ) + " " ) ; document . write ( " " + LCASQRT ( 3 , 13 ) + " " ) ;