priorityqueue

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 2 Imported by: 0

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 优先级队列

func New

func New(capacity int64) *PriorityQueue

New 创建一个容量为 capacity 的优先级队列

func (*PriorityQueue) Len

func (p *PriorityQueue) Len() int

Len 队列长度

func (*PriorityQueue) Peek

func (p *PriorityQueue) Peek() (interface{}, int64, bool)

Peek 窥视一个优先级最小的元素

func (*PriorityQueue) Pop

func (p *PriorityQueue) Pop() (interface{}, int64, bool)

Pop 弹出一个优先级最小的元素

func (*PriorityQueue) Push

func (p *PriorityQueue) Push(value interface{}, Priority int64)

Push 插入一个元素

Jump to

Keyboard shortcuts

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