mirror of
https://github.com/krahets/hello-algo.git
synced 2026-03-31 09:14:00 +08:00
feat(go/tree): support array binary tree (#655)
This commit is contained in:
@@ -11,11 +11,11 @@ import (
|
||||
|
||||
func TestTreeNode(t *testing.T) {
|
||||
arr := []any{1, 2, 3, nil, 5, 6, nil}
|
||||
node := ArrToTree(arr)
|
||||
node := SliceToTree(arr)
|
||||
|
||||
// print tree
|
||||
PrintTree(node)
|
||||
|
||||
// tree to arr
|
||||
fmt.Println(TreeToArray(node))
|
||||
fmt.Println(TreeToSlice(node))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user