Documentation ¶ Index ¶ Variables type Heap func New[T any](less Less[T], indexChanged func(x T, i int), initial []T) Heap[T] func (h *Heap[T]) Grow(n int) func (h *Heap[T]) Item(i int) T func (h *Heap[T]) Iterate() iterator.Iterator[T] func (h *Heap[T]) Len() int func (h *Heap[T]) Peek() T func (h *Heap[T]) Pop() T func (h *Heap[T]) Push(item T) func (h *Heap[T]) RemoveAt(i int) func (h *Heap[T]) UpdateAt(i int, item T) type Less Constants ¶ This section is empty. Variables ¶ View Source var ErrHeapModified = errors.New("heap modified during iteration") Functions ¶ This section is empty. Types ¶ type Heap ¶ type Heap[T any] struct { // contains filtered or unexported fields } func New ¶ func New[T any](less Less[T], indexChanged func(x T, i int), initial []T) Heap[T] func (*Heap[T]) Grow ¶ func (h *Heap[T]) Grow(n int) func (*Heap[T]) Item ¶ func (h *Heap[T]) Item(i int) T func (*Heap[T]) Iterate ¶ func (h *Heap[T]) Iterate() iterator.Iterator[T] func (*Heap[T]) Len ¶ func (h *Heap[T]) Len() int func (*Heap[T]) Peek ¶ func (h *Heap[T]) Peek() T func (*Heap[T]) Pop ¶ func (h *Heap[T]) Pop() T func (*Heap[T]) Push ¶ func (h *Heap[T]) Push(item T) func (*Heap[T]) RemoveAt ¶ func (h *Heap[T]) RemoveAt(i int) func (*Heap[T]) UpdateAt ¶ func (h *Heap[T]) UpdateAt(i int, item T) type Less ¶ type Less[T any] func(a, b T) bool Duplicated from xsort to avoid dependency cycle. Source Files ¶ View all Source files heap.go Click to show internal directories. Click to hide internal directories.