Documentation ¶
Index ¶
- type Prque
- func (p *Prque) Empty() bool
- func (p *Prque) Peek() (interface{}, int64)
- func (p *Prque) Pop() (interface{}, int64)
- func (p *Prque) PopItem() interface{}
- func (p *Prque) Push(data interface{}, priority int64)
- func (p *Prque) Remove(i int) interface{}
- func (p *Prque) Reset()
- func (p *Prque) Size() int
- type SetIndexCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prque ¶
type Prque struct {
// contains filtered or unexported fields
}
Priority queue data structure.
func (*Prque) Peek ¶ added in v1.1.1
Peek returns the value with the greates priority but does not pop it off.
func (*Prque) Pop ¶
Pops the value with the greates priority off the stack and returns it. Currently no shrinking is done.
func (*Prque) PopItem ¶
func (p *Prque) PopItem() interface{}
Pops only the item from the queue, dropping the associated priority value.
type SetIndexCallback ¶ added in v1.1.1
type SetIndexCallback func(a interface{}, i int)
SetIndexCallback is called when the element is moved to a new index. Providing SetIndexCallback is optional, it is needed only if the application needs to delete elements other than the top one.
Click to show internal directories.
Click to hide internal directories.