If either n1 or n2 matches with root 's key, report the presence  by setting v1 or v2 as true and return root (Note that if a key is ancestor of other, then the ancestor key becomes LCA)
if ( node . data == n1 ) { v1 = true ; temp = node ; } if ( node . data == n2 ) { v2 = true ; temp = node ; }