priorityqueue

package
v0.0.0-...-118f76d Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LessFunc

type LessFunc[T any] func(lhs, rhs T) bool

LessFunc is an ordering function.

type PriorityQueue

type PriorityQueue[T any] interface {
	// Size gets number of element in a queue.
	Size() int
	// Insert adds element to a queue.
	Insert(element T)
	// Remove removes element from a queue.
	Remove() T
	// Peek returns first element of a queue.
	Peek() T
}

PriorityQueue is priority queue data structure.

func New

func New[T any](less LessFunc[T]) PriorityQueue[T]

New create instance of PriorityQueue.

Jump to

Keyboard shortcuts

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