mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Add build script for Go and update Go codes.
This commit is contained in:
@ -11,7 +11,7 @@ import (
|
||||
. "github.com/krahets/hello-algo/pkg"
|
||||
)
|
||||
|
||||
func TestLevelOrder(t *testing.T) {
|
||||
func TestHierOrder(t *testing.T) {
|
||||
/* 初始化二叉树 */
|
||||
// 这里借助了一个从数组直接生成二叉树的函数
|
||||
root := ArrToTree([]any{1, 2, 3, 4, 5, 6, 7})
|
||||
@ -19,6 +19,6 @@ func TestLevelOrder(t *testing.T) {
|
||||
PrintTree(root)
|
||||
|
||||
// 层序遍历
|
||||
nums := levelOrder(root)
|
||||
nums := hierOrder(root)
|
||||
fmt.Println("\n层序遍历的结点打印序列 =", nums)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user