Driver code
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 ) ; Console . WriteLine ( " LCA ( 4 , ▁ 5 ) ▁ = ▁ " + tree . findLCA ( 4 , 5 ) . data ) ; Console . WriteLine ( " LCA ( 4 , ▁ 6 ) ▁ = ▁ " + tree . findLCA ( 4 , 6 ) . data ) ; Console . WriteLine ( " LCA ( 3 , ▁ 4 ) ▁ = ▁ " + tree . findLCA ( 3 , 4 ) . data ) ; Console . WriteLine ( " LCA ( 2 , ▁ 4 ) ▁ = ▁ " + tree . findLCA ( 2 , 4 ) . data ) ; } }