pdeque

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Less

type Less func(a interface{}, b interface{}) bool

Less is compare function for elements in queue

type LvTy

type LvTy int

LvTy is type of level

const (
	LvMin LvTy = iota
	LvMax
)

LvMin & LvMax in priority double-ended queue

type PriorityDeque

type PriorityDeque struct {
	// contains filtered or unexported fields
}

PriorityDeque is a priority double-ended queue

func NewPriorityDeque

func NewPriorityDeque(less Less) *PriorityDeque

NewPriorityDeque create a new PriorityDeque

func (*PriorityDeque) Insert

func (q *PriorityDeque) Insert(ele interface{})

Insert an item into priority deque

func (*PriorityDeque) Len

func (q *PriorityDeque) Len() int

Len return the length of the priority deque

func (*PriorityDeque) Max added in v1.0.0

func (q *PriorityDeque) Max() interface{}

Max return the max value in priority deque

func (*PriorityDeque) Min added in v1.0.0

func (q *PriorityDeque) Min() interface{}

Min return the min value in priority deque

func (*PriorityDeque) PopMax

func (q *PriorityDeque) PopMax() interface{}

PopMax pop the max value in priority deque

func (*PriorityDeque) PopMin

func (q *PriorityDeque) PopMin() interface{}

PopMin pop the min value in priority deque

Jump to

Keyboard shortcuts

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