queue

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[T any] struct {
	// our position in the input string
	Position int
	// current step in the Trie we are exploring
	Step *trie.Trie[T]
	// number of errors that can still be made
	ErrorsLeft int
}

type PriorityQueue

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

func New

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

func (*PriorityQueue[T]) Add

func (pq *PriorityQueue[T]) Add(item *Item[T])

Add an element to the priority queue. If item is nil, it's ignored.

func (*PriorityQueue[T]) Pop

func (pq *PriorityQueue[T]) Pop() *Item[T]

Pop and element from the priority queue. If the queue is empty, nil is returned.

Jump to

Keyboard shortcuts

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