Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue is an implementation of the priority queue, it can build a min/max order queue
func NewPriorityQueue ¶
func NewPriorityQueue() *PriorityQueue
NewPriorityQueue construct a new priority queue
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() Item
Pop removes an element, return an element to the caller, it adjusts orders of all items automatically
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(ele Item)
Push an element to PQ, it adjusts orders of all items automatically
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(k int) Item
Remove also see Pop method, but it can select anywhere
Click to show internal directories.
Click to hide internal directories.
