mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-02 03:05:24 +08:00
* feat(ko): add the complete Korean online edition * Use UTF-8 for Python CI output on Windows * Remove print-book promotion from the Korean site * fix(ko): preserve emphasis before Korean particles
22 lines
352 B
Go
22 lines
352 B
Go
// File: tree_node_test.go
|
|
// Created Time: 2022-11-25
|
|
// Author: Reanon ([email protected])
|
|
|
|
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))
|
|
}
|