hello-algo/codes/go/pkg/tree_node_test.go
Yudong Jin ebf9024136 Add Go codes to docs, including
the chapter of stack and queue, the chapter of tree.
2022-12-03 20:25:24 +08:00

22 lines
309 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 := ArrayToTree(arr)
// print tree
PrintTree(node)
// tree to arr
fmt.Println(TreeToArray(node))
}