package
Version:
v0.0.0-...-5cc1d31
Opens a new window with list of versions in this module.
Published: Jul 21, 2022
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Bst 二叉搜索树
func (tree *Bst) Delete(value int)
Delete 删除结点
被删除结点没有左结点,直接用右结点代替它
被删除结点没有右结点,用左结点代替它
被删除结点有左右结点,找到它的后继结点,把后继结点的值赋值给当前结点,删除右子树上的后继结点
func (tree *Bst) Insert(value int)
Insert 插入新结点
插入操作只会插在叶子结点后
Source Files
¶
Click to show internal directories.
Click to hide internal directories.