queues

package
v0.0.0-...-dc23390 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package queues provides queue data structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriorityQueue

type PriorityQueue interface {
	// Add adds the specified item to the priority queue.
	// Priority is a integer that represents the specified item's relative
	// priority: the bigger, the higher.
	Add(item interface{}, priority int)

	// Poll removes the lowest-priority item from the queue and returns it.
	Poll() (interface{}, bool)

	// Len is the number of items in the queue.
	Len() int
}

PriorityQueue represents a priority queue. This type is NOT thread-safe!

func NewPriorityQueue

func NewPriorityQueue(initialCapacity int) PriorityQueue

NewPriorityQueue creates a new instance of PriorityQueue.

Jump to

Keyboard shortcuts

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