Versions in this module Expand all Collapse all v0 v0.0.2 Nov 15, 2022 Changes in this version + const DefaultAryHeap + var ErrHeapIsEmpty = errors.New("heap is empty") + type Comparator func(a T, b T) int + func Float32Comparator() Comparator[float32] + func Float64Comparator() Comparator[float64] + func IntComparator() Comparator[int] + func StringComparator() Comparator[string] + func UintComparator() Comparator[uint] + type Heap struct + func New(comparator Comparator[T]) *Heap[T] + func NewWithOptions(options *Options[T]) *Heap[T] + func (x *Heap[T]) Clear() + func (x *Heap[T]) ExportDotLanguage() string + func (x *Heap[T]) IsEmpty() bool + func (x *Heap[T]) IsNotEmpty() bool + func (x *Heap[T]) Peek() T + func (x *Heap[T]) PeekE() (T, error) + func (x *Heap[T]) Pop() T + func (x *Heap[T]) PopE() (T, error) + func (x *Heap[T]) PopEach(eachFunc func(v T) bool) + func (x *Heap[T]) PopToSlice() []T + func (x *Heap[T]) PopTopN(n int) []T + func (x *Heap[T]) Push(valueSlice ...T) + func (x *Heap[T]) Size() int + type Interface interface + Clear func() + IsEmpty func() bool + IsNotEmpty func() bool + Peek func() T + PeekE func() (T, error) + Pop func() T + PopE func() (T, error) + PopEach func(eachFunc func(v T) bool) + PopTopN func(n int) []T + Push func(v ...T) + Size func() int + type Options struct + Ary int + Comparator Comparator[T] + InitSlice []T + type SyncHeap struct + func NewSync(comparator Comparator[T]) *SyncHeap[T] + func NewSyncWithOptions(options *Options[T]) *SyncHeap[T] + func (x *SyncHeap[T]) Clear() + func (x *SyncHeap[T]) IsEmpty() bool + func (x *SyncHeap[T]) IsNotEmpty() bool + func (x *SyncHeap[T]) Peek() T + func (x *SyncHeap[T]) PeekE() (T, error) + func (x *SyncHeap[T]) Pop() T + func (x *SyncHeap[T]) PopE() (T, error) + func (x *SyncHeap[T]) PopEach(eachFunc func(v T) bool) + func (x *SyncHeap[T]) PopTopN(n int) []T + func (x *SyncHeap[T]) Push(valueSlice ...T) + func (x *SyncHeap[T]) Size() int