queue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 4 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[V any] struct {
	// contains filtered or unexported fields
}

func FromPriorityHeap

func FromPriorityHeap[V any](h *heap.Heap[V]) *PriorityQueue[V]

func NewPriority

func NewPriority[V any](cmp structs.CompareFunc[V]) *PriorityQueue[V]

func NewPriorityCap

func NewPriorityCap[V any](capacity int, cmp structs.CompareFunc[V]) *PriorityQueue[V]

func (*PriorityQueue[V]) Clear

func (p *PriorityQueue[V]) Clear()

func (*PriorityQueue[V]) Contains

func (p *PriorityQueue[V]) Contains(value V) bool

func (*PriorityQueue[V]) Dequeue

func (p *PriorityQueue[V]) Dequeue() V

func (*PriorityQueue[V]) Enqueue

func (p *PriorityQueue[V]) Enqueue(value V)

func (*PriorityQueue[V]) IsEmpty

func (p *PriorityQueue[V]) IsEmpty() bool

func (*PriorityQueue[V]) Peek

func (p *PriorityQueue[V]) Peek() V

func (*PriorityQueue[V]) Size

func (p *PriorityQueue[V]) Size() int

func (*PriorityQueue[V]) Values

func (p *PriorityQueue[V]) Values() []V

type Queue

type Queue[V any] struct {
	// contains filtered or unexported fields
}

Queue is an implementation of a double-ended queue backed by *list.List

func New

func New[V any](eq structs.EqualFunc[V]) *Queue[V]

func NewOrdered

func NewOrdered[V constraints.Ordered]() *Queue[V]

func (*Queue[V]) Clear

func (q *Queue[V]) Clear()

func (*Queue[V]) Contains

func (q *Queue[V]) Contains(value V) bool

func (*Queue[V]) Dequeue

func (q *Queue[V]) Dequeue() V

func (*Queue[V]) DescendingIterator

func (q *Queue[V]) DescendingIterator() structs.Iterator[V]

func (*Queue[V]) Enqueue

func (q *Queue[V]) Enqueue(value V)

func (*Queue[V]) IsEmpty

func (q *Queue[V]) IsEmpty() bool

func (*Queue[V]) Iterator

func (q *Queue[V]) Iterator() structs.Iterator[V]

func (*Queue[V]) Peek

func (q *Queue[V]) Peek() V

func (*Queue[V]) Size

func (q *Queue[V]) Size() int

func (*Queue[V]) Values

func (q *Queue[V]) Values() []V

Jump to

Keyboard shortcuts

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