Documentation ¶
Index ¶
- func BuildHeap[VALUE any](heap Interface[VALUE])
- func Fix[VALUE any](h Interface[VALUE], i int)
- func Pop[VALUE any](heap Interface[VALUE]) (VALUE, error)
- func Push[VALUE any](heap Interface[VALUE], x VALUE)
- func Remove[VALUE any](heap Interface[VALUE], i int) (VALUE, error)
- type Constraint
- type Heap
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Constraint ¶
type Constraint[KEY comparable, VALUE any] interface { FormStoreKey(VALUE) KEY Less(VALUE, VALUE) bool }
type Heap ¶
type Heap[V any] interface { Add(value V) Delete(value V) error Peek() (V, error) Pop() (V, error) Get(value V) (V, bool) List() []V Len() int }
func New ¶
func New[KEY comparable, VALUE any](priority Constraint[KEY, VALUE]) Heap[VALUE]
New returns a heap which can be used to queue up items to process.
func NewConcurrent ¶
func NewConcurrent[VALUE any](priority Constraint[string, VALUE]) Heap[VALUE]
Click to show internal directories.
Click to hide internal directories.