README ¶ 二叉树的层序遍历 medium 给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。 示例: 二叉树:[3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其层次遍历结果: [ [3], [9,20], [15,7] ] Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func New(size int) *queue type TreeNode func PreIn2Tree(pre, in []int) *TreeNode Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func New ¶ func New(size int) *queue Types ¶ type TreeNode ¶ type TreeNode struct { Val int Left *TreeNode Right *TreeNode } func PreIn2Tree ¶ func PreIn2Tree(pre, in []int) *TreeNode Source Files ¶ View all Source files main.goutil.go Click to show internal directories. Click to hide internal directories.