Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BinarySearchTree ¶
type BinarySearchTree struct {
Root *TreeNode
}
二叉搜索树结构,里面保存一个根节点
func (*BinarySearchTree) Delete ¶
func (t *BinarySearchTree) Delete(key int)
func (*BinarySearchTree) InOrderTraversal ¶
func (t *BinarySearchTree) InOrderTraversal() []int
中序遍历
type BinarySearchTreeInterface ¶
type BinarySearchTreeInterface interface {
// 插入操作
// @param int 要插入的数据
Insert(int)
// 插入操作,支持批量插入
Inserts(...int)
// 查询操作
// @param int 要查询的数据
Search(int) *TreeNode
// 中序遍历,输出有序序列
InOrderTraversal() []int
// 删除操作
// @param int 要删除的数据
Delete(int)
}
接口定义
type LinkedList ¶
单链表数据结构
func (*LinkedList) ToArray ¶
func (l *LinkedList) ToArray() []any
链表转数组: 使用递归 + 闭包
@receiver linkList @return []any
type SqQueueInterface ¶
type SqStack ¶
SqStack 顺序栈,数组实现
type SqStackInterface ¶
Click to show internal directories.
Click to hide internal directories.