hello-algo/codes/go/pkg/tree_node_test.go

19 lines
291 B
Go
Raw Normal View History

2022-11-25 20:24:51 +08:00
// File: tree_node_test.go
// Created Time: 2022-11-25
// Author: Reanon (793584285@qq.com)
package pkg
import "testing"
func TestTreeNode(t *testing.T) {
arr := []int{2, 3, 5, 6, 7}
node := ArrayToTree(arr)
// print tree
PrintTree(node)
2022-11-26 11:11:40 +08:00
// tree to arr
t.Log(TreeToArray(node))
2022-11-25 20:24:51 +08:00
}