minheap

package
v0.0.0-...-0707981 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixMinHeap

func FixMinHeap[T MinHeapComparable[T]](h *[]T, i int)

func FixMinHeapOrdered

func FixMinHeapOrdered[T constraints.Ordered](h *[]T, i int)

func InitMinHeap

func InitMinHeap[T MinHeapComparable[T]](h *[]T)

func InitMinHeapOrdered

func InitMinHeapOrdered[T constraints.Ordered](h *[]T)

func PopMinHeap

func PopMinHeap[T MinHeapComparable[T]](h *[]T) T

func PopMinHeapOrdered

func PopMinHeapOrdered[T constraints.Ordered](h *[]T) T

func PushMinHeap

func PushMinHeap[T MinHeapComparable[T]](heapLimit int, h *[]T, x T)

heapLimit - size limit, if zero then unlimited

func PushMinHeapOrdered

func PushMinHeapOrdered[T constraints.Ordered](heapLimit int, h *[]T, x T)

heapLimit - size limit, if zero then unlimited

func RemoveMinHeap

func RemoveMinHeap[T MinHeapComparable[T]](h *[]T, i int) T

func RemoveMinHeapOrdered

func RemoveMinHeapOrdered[T constraints.Ordered](h *[]T, i int) T

Types

type MinHeapComparable

type MinHeapComparable[T any] interface {
	LessThan(T) bool
}

Jump to

Keyboard shortcuts

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