Documentation ¶
Index ¶
- type RBTree
- func (tree *RBTree) Back() *lst.Node
- func (tree *RBTree) Cleanup()
- func (tree *RBTree) Front() *lst.Node
- func (tree *RBTree) Len() int64
- func (tree *RBTree) Pop() *lst.Node
- func (tree *RBTree) Push(node *lst.Node)
- func (tree *RBTree) Range(fn func(*lst.Node) bool)
- func (tree *RBTree) Remove(node *lst.Node)
- func (tree *RBTree) Root() *lst.Node
- func (tree *RBTree) Slice() []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RBTree ¶ added in v2.2.3
type RBTree struct {
// contains filtered or unexported fields
}
RBTree 是一个结构体,表示一个红黑树 RBTree is a struct that represents a RED-BLACK tree
func New ¶
func New() *RBTree
New 函数用于创建一个新的红黑树, 返回一个指向红黑树的指针 The New function is used to create a new RED-BLACK tree, returning a pointer to the RED-BLACK tree
func (*RBTree) Back ¶ added in v2.2.3
Back 函数返回红黑树的尾节点 The Back function returns the tail node of the RED-BLACK tree
func (*RBTree) Cleanup ¶ added in v2.2.3
func (tree *RBTree) Cleanup()
Cleanup 函数用于清理红黑树 The Cleanup function is used to clean up the RED-BLACK tree
func (*RBTree) Front ¶ added in v2.2.3
Front 函数返回红黑树的头节点 The Front function returns the head node of the RED-BLACK tree
func (*RBTree) Len ¶ added in v2.2.3
Len 函数返回红黑树的节点数量 The Len function returns the number of nodes in the RED-BLACK tree
func (*RBTree) Pop ¶ added in v2.2.3
Pop 函数用于从红黑树中弹出节点 The Pop function is used to pop a node from the RED-BLACK tree
func (*RBTree) Push ¶ added in v2.2.3
Push 函数用于向红黑树中插入节点 The Push function is used to insert a node into the RED-BLACK tree
func (*RBTree) Range ¶ added in v2.2.3
Range 函数用于对红黑树进行范围操作 The Range function is used to perform range operations on the RED-BLACK tree
func (*RBTree) Remove ¶ added in v2.2.3
Remove 函数删除红黑树中的给定节点 The Remove function deletes the given node in the RED-BLACK tree