program from LeetCode to detect whether the two binary trees are the same