Let us create the Binary Tree as shown in the diagram .
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 ) ; root -> left -> right -> left = newNode ( 8 ) ; root -> left -> right -> right = newNode ( 9 ) ; int u = 4 , v = 9 ; printf ( " The ▁ LCA ▁ of ▁ node ▁ % d ▁ and ▁ node ▁ % d ▁ is ▁ node ▁ % d . STRNEWLINE " , u , v , findLCA ( root , u , v ) ) ; return 0 ; }