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 ΒΆ
func (*Heap) Peek ΒΆ
func (h *Heap) Peek() interface{}
Peek at the highest (or lowest) priority item
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.