Update binary_tree_bfs codes

This commit is contained in:
krahets
2023-02-15 03:36:22 +08:00
parent 8e0080f003
commit 7238c560d1
10 changed files with 19 additions and 19 deletions

View File

@ -11,7 +11,7 @@ import (
. "github.com/krahets/hello-algo/pkg"
)
func TestHierOrder(t *testing.T) {
func TestLevelOrder(t *testing.T) {
/* 初始化二叉树 */
// 这里借助了一个从数组直接生成二叉树的函数
root := ArrToTree([]any{1, 2, 3, 4, 5, 6, 7})
@ -19,6 +19,6 @@ func TestHierOrder(t *testing.T) {
PrintTree(root)
// 层序遍历
nums := hierOrder(root)
nums := levelOrder(root)
fmt.Println("\n层序遍历的结点打印序列 =", nums)
}