Number of nodes
addEdge ( 1 , 2 ) ; addEdge ( 1 , 3 ) ; addEdge ( 2 , 4 ) ; addEdge ( 2 , 5 ) ; addEdge ( 2 , 6 ) ; addEdge ( 3 , 7 ) ; addEdge ( 3 , 8 ) ; document . write ( " " + LCA ( 4 , 7 ) + " " ) ; document . write ( " " + LCA ( 4 , 6 ) + " " ) ;