package
Version:
v0.13.0-alpha.65
Opens a new window with list of versions in this module.
Published: Dec 25, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Heap
-
func (h *Heap[K, T]) Len() int
-
func (h *Heap[K, T]) Peek() (k K, v T, ok bool)
-
func (h *Heap[K, T]) Pop() (k K, v T, ok bool)
-
func (h *Heap[K, T]) Push(key K, data T)
-
func (h *Heap[K, T]) Remove(data T) bool
Heap is a generic heap implementation.
NewHeap creates a new heap.
Len returns the number of items in the queue.
func (h *Heap[K, T]) Peek() (k K, v T, ok bool)
Peek returns the next item in the queue without removing it.
func (h *Heap[K, T]) Pop() (k K, v T, ok bool)
Pop removes an item from the queue.
func (h *Heap[K, T]) Push(key K, data T)
Push adds an item to the queue.
func (h *Heap[K, T]) Remove(data T) bool
Remove removes an item from the queue.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.