Merge pull request #2564 from xingyiteng/leetcode101

Update 0101.对称二叉树.md 交换顺序
This commit is contained in:
程序员Carl 2024-06-20 10:08:44 +08:00 committed by GitHub
commit 843c3f7fa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -224,8 +224,8 @@ public:
st.push(root->left);
st.push(root->right);
while (!st.empty()) {
TreeNode* leftNode = st.top(); st.pop();
TreeNode* rightNode = st.top(); st.pop();
TreeNode* leftNode = st.top(); st.pop();
if (!leftNode && !rightNode) {
continue;
}
@ -950,3 +950,4 @@ public bool IsSymmetric(TreeNode root)
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>