Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type MinHeap ¶
type MinHeap[T Priorizable] struct { Queue PriorityQueue // hold the priority queue Storage []T // may or may not contain the items in the priority queue. Indexable directly by the ID }
func NewMinHeap ¶
func NewMinHeap[T Priorizable](items []T) *MinHeap[T]
type PriorityQueue ¶
type PriorityQueue []Priorizable
Implements heap.Interface
func (PriorityQueue) Len ¶
func (q PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (q PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() any
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(item any)
func (PriorityQueue) Swap ¶
func (q PriorityQueue) Swap(i, j int)
type Priorizable ¶
Click to show internal directories.
Click to hide internal directories.