heap

package
v2.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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

func (tree *RBTree) Back() *lst.Node

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

func (tree *RBTree) Front() *lst.Node

Front 函数返回红黑树的头节点 The Front function returns the head node of the RED-BLACK tree

func (*RBTree) Len added in v2.2.3

func (tree *RBTree) Len() int64

Len 函数返回红黑树的节点数量 The Len function returns the number of nodes in the RED-BLACK tree

func (*RBTree) Pop added in v2.2.3

func (tree *RBTree) Pop() *lst.Node

Pop 函数用于从红黑树中弹出节点 The Pop function is used to pop a node from the RED-BLACK tree

func (*RBTree) Push added in v2.2.3

func (tree *RBTree) Push(node *lst.Node)

Push 函数用于向红黑树中插入节点 The Push function is used to insert a node into the RED-BLACK tree

func (*RBTree) Range added in v2.2.3

func (tree *RBTree) Range(fn func(*lst.Node) bool)

Range 函数用于对红黑树进行范围操作 The Range function is used to perform range operations on the RED-BLACK tree

func (*RBTree) Remove added in v2.2.3

func (tree *RBTree) Remove(node *lst.Node)

Remove 函数删除红黑树中的给定节点 The Remove function deletes the given node in the RED-BLACK tree

func (*RBTree) Root added in v2.2.3

func (tree *RBTree) Root() *lst.Node

Root 函数返回红黑树的根节点 The Root function returns the root node of the RED-BLACK tree

func (*RBTree) Slice added in v2.2.3

func (tree *RBTree) Slice() []interface{}

Slice 函数返回红黑树的节点值的切片 The Slice function returns a slice of node values in the RED-BLACK tree

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL