Driver program to test above functions
public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; tree . root . left . left = new Node ( 4 ) ; tree . root . left . right = new Node ( 5 ) ; tree . root . right . left = new Node ( 6 ) ; tree . root . right . right = new Node ( 7 ) ; Node lca = tree . findLCA ( 4 , 5 ) ; if ( lca != null ) { Console . WriteLine ( " LCA ( 4 , ▁ 5 ) ▁ = ▁ " + lca . data ) ; } else { Console . WriteLine ( " Keys ▁ are ▁ not ▁ present " ) ; } lca = tree . findLCA ( 4 , 10 ) ; if ( lca != null ) { Console . WriteLine ( " LCA ( 4 , ▁ 10 ) ▁ = ▁ " + lca . data ) ; } else { Console . WriteLine ( " Keys ▁ are ▁ not ▁ present " ) ; } } }