mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-27 13:36:28 +08:00
dcc3b2e35b
in java, cpp, py, go, js, ts.
21 lines
307 B
Go
21 lines
307 B
Go
// File: tree_node_test.go
|
|
// Created Time: 2022-11-25
|
|
// Author: Reanon (793584285@qq.com)
|
|
|
|
package pkg
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestTreeNode(t *testing.T) {
|
|
arr := []int{2, 3, 5, 6, 7}
|
|
node := ArrToTree(arr)
|
|
|
|
// print tree
|
|
PrintTree(node)
|
|
|
|
// tree to arr
|
|
fmt.Println(TreeToArray(node))
|
|
}
|