103. Binary Tree Zigzag Level Order Traversal - #26
Open
miyataka wants to merge 1 commit into
Open
Conversation
miyataka
force-pushed
the
103_BinaryTreeZigzagLevelOrderTraversal
branch
from
July 13, 2026 18:35
fed5243 to
347417b
Compare
skypenguins
reviewed
Jul 20, 2026
| - 他の人も書いているが読みやすい. | ||
| - 計算量についてふれてもいいかもしれない.N<=2000なので,心配するほどではないという捉え方もできる | ||
| - https://github.com/h-masder/Arai60/pull/30 | ||
| - pythonの`[::-1]`とか全然知らなかったな |
There was a problem hiding this comment.
これはスライスですね。
公式ドキュメントは https://docs.python.org/ja/3.13/library/functions.html#slice あたりの認識です。
Owner
Author
There was a problem hiding this comment.
返信が遅れました.
教えていただきありがとうございます.
|
全体的に読みやすいと思いました。 |
nodchip
reviewed
Jul 21, 2026
| layerNum := 0 | ||
| frontier := []*TreeNode{root} | ||
| for len(frontier) > 0 { | ||
| nextLayer := []*TreeNode{} |
There was a problem hiding this comment.
frontier と nextLayer で、同じようなものを格納する変数の変数名に、異なる単語が使われているのが気になりました。自分なら frontier と nextFrontier と名付けると思います。好みの問題かもしれません。
Owner
Author
There was a problem hiding this comment.
返信が遅れてすみません
たしかにそう思いました.次からそうします.
| frontier := []*TreeNode{root} | ||
| for len(frontier) > 0 { | ||
| nextLayer := []*TreeNode{} | ||
| sameLayerVals := []int{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/