天天看點

Leetcode:Same Tree

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.

分析:對于二叉樹這一具有天然遞歸特性的資料結構,首先想到的就應該是遞歸,既然是遞歸,最重要就是邊界了