Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue []*PQItem
Priority queue is based on a regular array
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
Len returns the length of a priority queue
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
Less defines the order between two priority queue entries
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
Pop pulls the top (max priority) element from a priority queue. Complexity: O(1)
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
Push inserts an element to a priority queue. Complexity: O(logN)
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Swap is used for swapping two priority queue elements on sorting
Click to show internal directories.
Click to hide internal directories.