Driver program to test above function
root = Node ( 1 ) NEW_LINE root . left = Node ( 2 ) NEW_LINE root . right = Node ( 3 ) NEW_LINE root . left . left = Node ( 4 ) NEW_LINE root . left . right = Node ( 5 ) NEW_LINE root . right . left = Node ( 6 ) NEW_LINE root . right . right = Node ( 7 ) NEW_LINE lca = findLCA ( root , 4 , 5 ) NEW_LINE if lca is not None : NEW_LINE INDENT print " LCA ( 4 , ▁ 5 ) ▁ = ▁ " , lca . key NEW_LINE DEDENT else : NEW_LINE INDENT print " Keys ▁ are ▁ not ▁ present " NEW_LINE DEDENT lca = findLCA ( root , 4 , 10 ) NEW_LINE if lca is not None : NEW_LINE INDENT print " LCA ( 4,10 ) ▁ = ▁ " , lca . key NEW_LINE DEDENT else : NEW_LINE INDENT print " Keys ▁ are ▁ not ▁ present " NEW_LINE DEDENT