Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
判斷兩棵二叉樹是否相等,即結構相同,且對應的節點具有相同的值
思路:由樹的前序、中序和後序遍歷,想到用遞歸的方法,先判斷根節點是否相同,再依次判斷左子樹和右子樹是否相同。
代碼AC: