Documentation
¶
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 heap implementation using generic.
func NewAny ¶
NewAny gives a new heap object. element can be anything, but must provide less function.
func (*Heap[T]) Pop ¶
func (h *Heap[T]) Pop()
Pop removes the minimum element (according to Less) from the heap. The complexity is O(log n) where n = h.Len().
Click to show internal directories.
Click to hide internal directories.