Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinHeap ¶
type MinHeap []*PQItem
Priority queue is based on a regular array
func (*MinHeap) Peek ¶
func (h *MinHeap) Peek() interface{}
Peek returns the top element (min priority)
func (*MinHeap) Pop ¶
func (h *MinHeap) Pop() interface{}
Pop pulls the top (max priority) element from a priority queue. Complexity: O(1)
func (*MinHeap) Push ¶
func (h *MinHeap) Push(x interface{})
Push inserts an element to a priority queue. Complexity: O(logN)
Click to show internal directories.
Click to hide internal directories.