Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0226翻转二叉树,删除冗余代码 #2766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZaneCodeJourney
Copy link

修改说明
在循环 while queue: 内遍历二叉树时,for i in range(len(queue)) 用于确保循环内的操作局限于某一层。但在本题中,仅需对每个节点的两个子节点进行翻转,不需要这个冗余的循环。因此,直接删除该循环。删除后,代码仍然能够正确运行并通过提交。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant