Documentation
¶
Overview ¶
Package heap provides an implementation of heap data structure in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element[T any] struct { Value T // contains filtered or unexported fields }
Element is an element in the heap.
type Heap ¶
type Heap[T comparable] struct { // contains filtered or unexported fields }
Heap represents a heap.
func NewFunc ¶
func NewFunc[T comparable](less algorithm.LessFunc[T]) *Heap[T]
NewFunc creates a new heap of T using less.
func (*Heap[T]) Fix ¶
Fix fixes the position of value in the heap data structure. It should be called after its data changes.
Click to show internal directories.
Click to hide internal directories.