Driver program to test above functions
int main ( ) { Node * root = newNode ( 1 ) ; root -> left = newNode ( 2 ) ; root -> right = newNode ( 3 ) ; root -> left -> left = newNode ( 4 ) ; root -> left -> right = newNode ( 5 ) ; root -> right -> left = newNode ( 6 ) ; root -> right -> right = newNode ( 7 ) ; Node * lca = findLCA ( root , 4 , 5 ) ; if ( lca != NULL ) cout << " LCA ( 4 , ▁ 5 ) ▁ = ▁ " << lca -> key ; else cout << " Keys ▁ are ▁ not ▁ present ▁ " ; lca = findLCA ( root , 4 , 10 ) ; if ( lca != NULL ) cout << " nLCA ( 4 , ▁ 10 ) ▁ = ▁ " << lca -> key ; else cout << " nKeys ▁ are ▁ not ▁ present ▁ " ; return 0 ; }