mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
Update
This commit is contained in:
@ -91,6 +91,8 @@
|
|||||||
* [二叉树:我对称么?](https://mp.weixin.qq.com/s/Kgf0gjvlDlNDfKIH2b1Oxg)
|
* [二叉树:我对称么?](https://mp.weixin.qq.com/s/Kgf0gjvlDlNDfKIH2b1Oxg)
|
||||||
* [二叉树:看看这些树的最大深度](https://mp.weixin.qq.com/s/guKwV-gSNbA1CcbvkMtHBg)
|
* [二叉树:看看这些树的最大深度](https://mp.weixin.qq.com/s/guKwV-gSNbA1CcbvkMtHBg)
|
||||||
* [二叉树:看看这些树的最小深度](https://mp.weixin.qq.com/s/BH8-gPC3_QlqICDg7rGSGA)
|
* [二叉树:看看这些树的最小深度](https://mp.weixin.qq.com/s/BH8-gPC3_QlqICDg7rGSGA)
|
||||||
|
* [二叉树:我有多少个节点?](https://mp.weixin.qq.com/s/2_eAjzw-D0va9y4RJgSmXw)
|
||||||
|
* [二叉树:我平衡么?](https://mp.weixin.qq.com/s/isUS-0HDYknmC0Rr4R8mww)
|
||||||
|
|
||||||
|
|
||||||
(持续更新中....)
|
(持续更新中....)
|
||||||
|
@ -89,8 +89,8 @@ public:
|
|||||||
|
|
||||||
// 此时就是:左右节点都不为空,且数值相同的情况
|
// 此时就是:左右节点都不为空,且数值相同的情况
|
||||||
// 此时才做递归,做下一层的判断
|
// 此时才做递归,做下一层的判断
|
||||||
bool outside = compare(left->left, right->right); // 左子树:左、 右子树:右
|
bool outside = compare(left->left, right->right); // 左子树:左、 右子树:左
|
||||||
bool inside = compare(left->right, right->left); // 左子树:右、 右子树:左
|
bool inside = compare(left->right, right->left); // 左子树:右、 右子树:右
|
||||||
bool isSame = outside && inside; // 左子树:中、 右子树:中 (逻辑处理)
|
bool isSame = outside && inside; // 左子树:中、 右子树:中 (逻辑处理)
|
||||||
return isSame;
|
return isSame;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user