1. The two nodes should be on the same level in the binary tree The two nodes should not be siblings ( means that they should not have the smae parent node
if ( ( level ( root , a , 1 ) == level ( root , b , 1 ) ) and not ( isSibling ( root , a , b ) ) ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT else : NEW_LINE INDENT return 0 NEW_LINE DEDENT