priority_queue

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoElements = errors.New("queue is empty")

Functions

func New

func New[T any]() *priorityQueue[T]

Types

type Node

type Node[T any] struct {
	Payload  T
	Priority uint
}

type PriorityQueue

type PriorityQueue[T any] interface {
	Push(n Node[T])
	Pop() (Node[T], error)
	Size() int
	Items() []Node[T]
}

Jump to

Keyboard shortcuts

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