prque

package
v0.0.0-...-f8b7a73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

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
}

优先级队列数据结构。

func New

func New(setIndex setIndexCallback) *Prque

创建新的优先级队列。

func (*Prque) Empty

func (p *Prque) Empty() bool

检查优先级队列是否为空。

func (*Prque) Pop

func (p *Prque) Pop() (interface{}, int64)

从堆栈中弹出优先级为greates的值并返回该值。 目前还没有收缩。

func (*Prque) PopItem

func (p *Prque) PopItem() interface{}

只从队列中弹出项目,删除关联的优先级值。

func (*Prque) Push

func (p *Prque) Push(data interface{}, priority int64)

将具有给定优先级的值推入队列,必要时展开。

func (*Prque) Remove

func (p *Prque) Remove(i int) interface{}

移除移除具有给定索引的元素。

func (*Prque) Reset

func (p *Prque) Reset()

清除优先级队列的内容。

func (*Prque) Size

func (p *Prque) Size() int

返回优先级队列中的元素数。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL