Documentation
¶
Overview ¶
Package heaps provides generic heaps.
This package provides better run speeds than the standard [heap] package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap[T any] struct { // contains filtered or unexported fields }
Heap is a generic heap.
func Max ¶
func Max[T constraints.Ordered]() *Heap[T]
Max returns a new max-heap of an ordered type by its natural order.
func Min ¶
func Min[T constraints.Ordered]() *Heap[T]
Min returns a new min-heap of an ordered type by its natural order.
func (*Heap[T]) Push ¶
func (h *Heap[T]) Push(x T)
Push adds x to h while maintaining its heap invariants.
Click to show internal directories.
Click to hide internal directories.