sevki.org/pqueue

go get sevki.org/pqueue

Index

Package Files

pqueue.go

type Item

type Item interface {
    Priority() int
}

Item is the interface that is necessary for priorityqueue to figure out priorities

type PQueue

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

PQueue is a thread safe priorityqueue

func New

func New() *PQueue

New returns a new queue

func (*PQueue) Pop

func (q *PQueue) Pop() Item

Pop returns an element from the queue blocks until it can return an element

func (*PQueue) Push

func (q *PQueue) Push(i Item)

Push adds a new item to the queue

Subdirectories