diff --git a/problems/0102.二叉树的层序遍历.md b/problems/0102.二叉树的层序遍历.md index 9b5f9ed5..0ab67b13 100644 --- a/problems/0102.二叉树的层序遍历.md +++ b/problems/0102.二叉树的层序遍历.md @@ -657,8 +657,36 @@ Python: Go: +```Go +func levelOrder(root *TreeNode) [][]int { + result:=make([][]int,0) + if root==nil{ + return result + } + queue:=make([]*TreeNode,0) + queue=append(queue,root) + for len(queue)>0{ + list:=make([]int,0) + l:=len(queue) + + for i:=0;i