You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hello-algo/codes/go/chapter_tree/binary_search_tree.go

21 lines
333 B

// 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
}