Exactly one of the n1 and n2 is None , trees are not isomorphic
if n1 is None or n2 is None : NEW_LINE INDENT return False NEW_LINE DEDENT if n1 . data != n2 . data : NEW_LINE INDENT return False NEW_LINE DEDENT