heap

package
v0.0.0-...-e704afa Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Less

func Less[T cmp.Ordered](a, b T) bool

Types

type Heap

type Heap[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T cmp.Ordered]() *Heap[T]

func NewWithLess

func NewWithLess[T any](less func(a, b T) bool) *Heap[T]

func (*Heap[T]) Clear

func (h *Heap[T]) Clear()

func (*Heap[T]) IsEmpty

func (h *Heap[T]) IsEmpty() bool

func (*Heap[T]) Len

func (h *Heap[T]) Len() int

func (*Heap[T]) Less

func (h *Heap[T]) Less(i, j int) bool

DEPRECATED: DO NOT USE

func (*Heap[T]) Peek

func (h *Heap[T]) Peek() T

func (*Heap[T]) Pop

func (h *Heap[T]) Pop() any

DEPRECATED: Use PopItem instead

func (*Heap[T]) PopItem

func (h *Heap[T]) PopItem() T

func (*Heap[T]) Push

func (h *Heap[T]) Push(x any)

DEPRECATED: Use PushItem instead

func (*Heap[T]) PushItem

func (h *Heap[T]) PushItem(x T)

func (*Heap[T]) Slice

func (h *Heap[T]) Slice() []T

func (Heap[T]) Swap

func (h Heap[T]) Swap(i, j int)

DEPRECATED: DO NOT USE

Jump to

Keyboard shortcuts

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