hello-algo/codes/go/chapter_tree/binary_search_tree.go
2022-11-25 20:24:51 +08:00

21 lines
333 B
Go

// File: binary_search_tree.go
// Created Time: 2022-11-25
// Author: Reanon (793584285@qq.com)
package chapter_tree
import (
. "github.com/krahets/hello-algo/pkg"
"sort"
)
type BinarySearchTree struct {
root *TreeNode
}
func NewBinarySearchTree(nums []int) *BinarySearchTree {
// 排序数组
sort.Ints(nums)
return nil
}