heap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 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 Heap

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

func NewMaxHeap

func NewMaxHeap[T cmp.Ordered](initialItems []T) *Heap[T]

func NewMaxHeapCmp

func NewMaxHeapCmp[T any](initialItems []T, checkIsLess func(smaller, bigger T) bool) *Heap[T]

func NewMinHeap

func NewMinHeap[T cmp.Ordered](initialItems []T) *Heap[T]

func NewMinHeapCmp

func NewMinHeapCmp[T any](initialItems []T, checkIsLess func(smaller, bigger T) bool) *Heap[T]

func (*Heap[T]) Len

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

func (*Heap[T]) Peek

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

func (*Heap[T]) Pop

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

func (*Heap[T]) Push

func (h *Heap[T]) Push(item T)

Jump to

Keyboard shortcuts

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