Skip to content

Binary Tree Zigzag Level Order Traversal#32

Open
Yuto729 wants to merge 1 commit intomainfrom
binary-tree-zigzag-level-order-traversal
Open

Binary Tree Zigzag Level Order Traversal#32
Yuto729 wants to merge 1 commit intomainfrom
binary-tree-zigzag-level-order-traversal

Conversation

@Yuto729
Copy link
Owner

@Yuto729 Yuto729 commented Mar 27, 2026

Repository owner deleted a comment from github-actions bot Mar 27, 2026
return []

level = 0
frontiers = deque([(root, level)])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

単数系 frontier の方が一般的だと思います(自分も複数形にしていました)

- In: [], Out: []

BFSで解く. 前問とは異なり, 奇数レベルのときは逆順に格納するようにする
以下はレベルごとに一括で処理をし, queueを差し替える方法
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: list を差し替える方法だと思います。

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.

3 participants