题目
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.
分析
判断两个树是否完全相同
代码
|
|
点评
深度优先,递归判断,结束条件就是节点为空
思危、思退、思变
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.
判断两个树是否完全相同
|
|
深度优先,递归判断,结束条件就是节点为空