Function to merge given two binary trees
def MergeTrees ( t1 , t2 ) : NEW_LINE INDENT if ( not t1 ) : NEW_LINE INDENT return t2 NEW_LINE DEDENT if ( not t2 ) : NEW_LINE INDENT return t1 NEW_LINE DEDENT t1 . data += t2 . data NEW_LINE t1 . left = MergeTrees ( t1 . left , t2 . left ) NEW_LINE t1 . right = MergeTrees ( t1 . right , t2 . right ) NEW_LINE return t1 NEW_LINE DEDENT