Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
A binary heap for Priority Queues. The priorities are modeled explicitly as integers. It can work either as a min heap or a max heap.
func NewHeap ¶
Make a new binary heap. size : hint for the size of the heap
(should estimate the maximal size)
min : false == max heap, true == min heap
func NewMaxHeap ¶
func NewMinHeap ¶
type PriorityQueue ¶
type UniquePQ ¶
type UniquePQ struct {
// contains filtered or unexported fields
}
This priority queue only allows unique entries. Internally this is implemented using a Hash set. All items added must be types.Hashable
func NewUnique ¶
func NewUnique(pq PriorityQueue) *UniquePQ
Construct a new unique priority queue using the provided priority queue.
Click to show internal directories.
Click to hide internal directories.