priorityqueue

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 3 Imported by: 1

README

Build Status

priorityqueue

Priority queue implimentation in golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxQueueFunc

func MaxQueueFunc(pi, pj int) bool

func MinQueueFunc

func MinQueueFunc(pi, pj int) bool

Types

type Element

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

An Element is what's held by the priority queue

type PriorityQueue

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

func New

func (*PriorityQueue) Len

func (pq *PriorityQueue) Len() int

Len returns the number of elements in the queue

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() (interface{}, int, error)

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(value interface{}, priority int)

func (*PriorityQueue) Top

func (pq *PriorityQueue) Top() (interface{}, int, error)

type PriorityQueueType

type PriorityQueueType uint8
const (
	MinQueue PriorityQueueType = iota + 1 //Configures the queue to return the smallest element on pop
	MaxQueue PriorityQueueType = iota + 1 //Configures the queue to return the largest element on pop
)

func (PriorityQueueType) String

func (i PriorityQueueType) String() string

Jump to

Keyboard shortcuts

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