mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
Fix a comment in binary_tree_bfs.go
This commit is contained in:
@ -18,7 +18,7 @@ func levelOrder(root *TreeNode) []int {
|
||||
// 初始化一个切片,用于保存遍历序列
|
||||
nums := make([]int, 0)
|
||||
for queue.Len() > 0 {
|
||||
// 队首元素出队
|
||||
// 队列出队
|
||||
node := queue.Remove(queue.Front()).(*TreeNode)
|
||||
// 保存结点值
|
||||
nums = append(nums, node.Val)
|
||||
|
||||
Reference in New Issue
Block a user