priorityqueue

package
v0.0.0-...-fa05059 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOutOfCapacity = errors.New("out of capacity")

Functions

This section is empty.

Types

type PriorityQueue

type PriorityQueue[T any] struct {
	// contains filtered or unexported fields
}

func NewPriorityQueue

func NewPriorityQueue[T any](capacity int, less func(a, b T) bool) *PriorityQueue[T]

func (*PriorityQueue[T]) Dequeue

func (pq *PriorityQueue[T]) Dequeue() (T, error)

func (*PriorityQueue[T]) Enqueue

func (pq *PriorityQueue[T]) Enqueue(item T) error

func (*PriorityQueue[T]) Len

func (pq *PriorityQueue[T]) Len() int

func (*PriorityQueue[T]) Less

func (pq *PriorityQueue[T]) Less(i, j int) bool

func (*PriorityQueue[T]) Pop

func (pq *PriorityQueue[T]) Pop() interface{}

func (*PriorityQueue[T]) Push

func (pq *PriorityQueue[T]) Push(x interface{})

func (*PriorityQueue[T]) Swap

func (pq *PriorityQueue[T]) Swap(i, j int)

Jump to

Keyboard shortcuts

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