Documentation ¶
Index ¶
- type Heap
- func (h *Heap) Back() *lst.Node
- func (h *Heap) Cleanup()
- func (h *Heap) Front() *lst.Node
- func (h *Heap) GetList() *lst.List
- func (h *Heap) Len() int64
- func (h *Heap) Pop() *lst.Node
- func (h *Heap) Push(n *lst.Node)
- func (h *Heap) Range(fn func(*lst.Node) bool)
- func (h *Heap) Remove(node *lst.Node)
- func (h *Heap) Slice() []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
Heap 结构体表示一个堆,它包含一个链表。 The Heap struct represents a heap, which contains a list.
func New ¶
func New() *Heap
New 函数创建并返回一个新的 Heap 实例。 The New function creates and returns a new Heap instance.
func (*Heap) Cleanup ¶
func (h *Heap) Cleanup()
Cleanup 方法清理堆,移除所有节点。 The Cleanup method cleans up the heap, removing all nodes.
func (*Heap) GetList ¶
GetList 方法返回堆的内部列表。 The GetList method returns the internal list of the heap.
func (*Heap) Pop ¶
Pop 方法移除并返回堆的第一个节点。 The Pop method removes and returns the first node of the heap.
func (*Heap) Range ¶
Range 方法对堆中的每个节点执行函数 fn。 The Range method executes function fn for each node in the heap.
Click to show internal directories.
Click to hide internal directories.