collection

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaxHeap

type MaxHeap[T cmp.Ordered] struct {
	// contains filtered or unexported fields
}

MaxHeap 是一个泛型最大堆结构

func NewMaxHeap

func NewMaxHeap[T cmp.Ordered]() *MaxHeap[T]

NewMaxHeap 创建一个新的最大堆

func (*MaxHeap[T]) Pop

func (h *MaxHeap[T]) Pop() (T, bool)

Pop 从堆中移除并返回最大元素

func (*MaxHeap[T]) Push

func (h *MaxHeap[T]) Push(value T)

Push 向堆中插入一个元素

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳