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 is a producer/consumer queue that implements a heap data structure. It can be used to implement priority queues and similar data structures.
func (*Heap[T]) PushIfNotPresent ¶
PushIfNotPresent inserts an item to the queue. If an item with the key is present in the map, no changes is made to the item.
func (*Heap[T]) PushOrUpdate ¶
func (h *Heap[T]) PushOrUpdate(obj *T)
PushOrUpdate inserts an item to the queue. The item will be updated if it already exists.
Click to show internal directories.
Click to hide internal directories.