1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 07:02:29 +08:00

feat: add IsSubTree func for BSTree

This commit is contained in:
dudaodong
2022-04-27 10:36:11 +08:00
parent 155f287ab0
commit e98c46c903
3 changed files with 53 additions and 14 deletions

View File

@@ -40,12 +40,12 @@ func NewQueueNode[T any](value T) *QueueNode[T] {
// TreeNode is node of tree
type TreeNode[T any] struct {
Data T
Value T
Left *TreeNode[T]
Right *TreeNode[T]
}
// NewTreeNode return a TreeNode pointer
func NewTreeNode[T any](data T) *TreeNode[T] {
return &TreeNode[T]{data, nil, nil}
func NewTreeNode[T any](val T) *TreeNode[T] {
return &TreeNode[T]{val, nil, nil}
}