Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparable ¶
type Heap ¶
type Heap[Key Comparable[Key], Value any] []*HeapElement[Key, Value]
Heap defines a heap based on times.
func (Heap[K, V]) Less ¶
Less reports whether the element with index i should sort before the element with index j.
func (*Heap[K, V]) Pop ¶
func (h *Heap[K, V]) Pop() interface{}
Pop removes and returns the last element of the heap.
type HeapElement ¶
type HeapElement[K Comparable[K], V any] struct { // Value represents the value of the queued element. Value V // Key represents the time of the element to be used as a key. Key K // contains filtered or unexported fields }
func (HeapElement[K, V]) Index ¶
func (h HeapElement[K, V]) Index() int
Click to show internal directories.
Click to hide internal directories.