heap

package
v0.0.0-...-6223b4e Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyHeapErr = errors.New("heap: empty heap")

Functions

This section is empty.

Types

type Heap

type Heap[T any] interface {
	Push(T)
	Pop() (T, error)
	Peek() (T, error)
	Len() int
}

func NewHeapWithComparator

func NewHeapWithComparator[T any](size int, comparator func(a, b T) bool) Heap[T]

func NewMaxHeap

func NewMaxHeap[T constraints.Ordered](size int) Heap[T]

func NewMinHeap

func NewMinHeap[T constraints.Ordered](size int) Heap[T]

Jump to

Keyboard shortcuts

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