Documentation ¶
Index ¶
- func AddNode(pq *PriorityQueue, key, value interface{}, priority float64)
- func RemoveNode(pq *PriorityQueue, values ...interface{})
- type Node
- type Nodes
- type PriorityQueue
- func (pq *PriorityQueue) AddNode(key, value interface{}, priority float64)
- func (pq *PriorityQueue) Length() int
- func (pq *PriorityQueue) Pop() *Node
- func (pq *PriorityQueue) Pull(values ...interface{}) *Node
- func (pq *PriorityQueue) Push(n *Node)
- func (pq *PriorityQueue) Remove(index int)
- func (pq *PriorityQueue) RemoveNode(values ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNode ¶
func AddNode(pq *PriorityQueue, key, value interface{}, priority float64)
func RemoveNode ¶
func RemoveNode(pq *PriorityQueue, values ...interface{})
Types ¶
type Node ¶
type Node struct { Key interface{} Value interface{} Priority float64 Index int // contains filtered or unexported fields }
func (*Node) UpdatePriority ¶
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func NewPriorityQueue ¶
func NewPriorityQueue() *PriorityQueue
func (*PriorityQueue) AddNode ¶
func (pq *PriorityQueue) AddNode(key, value interface{}, priority float64)
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() *Node
func (*PriorityQueue) Pull ¶
func (pq *PriorityQueue) Pull(values ...interface{}) *Node
Pull 拉取匹配的第一个Node返回
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(n *Node)
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(index int)
func (*PriorityQueue) RemoveNode ¶
func (pq *PriorityQueue) RemoveNode(values ...interface{})
Click to show internal directories.
Click to hide internal directories.