mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-11 00:11:00 +08:00
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
22 lines
343 B
Go
22 lines
343 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 := []any{1, 2, 3, nil, 5, 6, nil}
|
|
node := SliceToTree(arr)
|
|
|
|
// 木を表示する
|
|
PrintTree(node)
|
|
|
|
// 木を配列に変換する
|
|
fmt.Println(TreeToSlice(node))
|
|
}
|