add bst
Some checks failed
Lint / golangci-lint (push) Has been cancelled
Declarative Tests / test (push) Has been cancelled
Declarative Tests / build-fedora (push) Has been cancelled
Declarative Tests / build-ubuntu-focal (push) Has been cancelled

This commit is contained in:
Matthew Rich 2024-09-19 08:17:00 +00:00
parent 20a4e1a89d
commit 8910fced57

View File

@ -32,7 +32,7 @@ type BinaryTree[Key cmp.Ordered] struct {
func NewBinaryTree[Key cmp.Ordered](capacity int) (bst *BinaryTree[Key]) { func NewBinaryTree[Key cmp.Ordered](capacity int) (bst *BinaryTree[Key]) {
tree := make(Binary[Key], 1, capacity) tree := make(Binary[Key], 1, capacity)
bst = &BinaryTree[Key]{ Binary: &tree } bst = &BinaryTree[Key]{ Binary: &tree, least: 0, greatest: 0, lastNode: 0 }
return return
} }