Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap[E any] struct { // contains filtered or unexported fields }
A Heap is a min-heap backed by a slice.
func (*Heap[E]) Peek ¶
func (h *Heap[E]) Peek() E
Peek returns the minimum element (according to the less function) in the heap. Peek panics if the heap is empty. The complexity is O(1).
Click to show internal directories.
Click to hide internal directories.