priority

package
v0.0.0-...-94f88f4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heap

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

func MakeEmptyHeap

func MakeEmptyHeap[T any](compare func(a T, b T) int) *Heap[T]

func MakeHeap

func MakeHeap[T any](values []T, compare func(a T, b T) int) *Heap[T]

func (*Heap[T]) Insert

func (heap *Heap[T]) Insert(value T)

func (*Heap[T]) IsEmpty

func (heap *Heap[T]) IsEmpty() bool

func (*Heap[T]) Min

func (heap *Heap[T]) Min() T

func (*Heap[T]) RemoveMin

func (heap *Heap[T]) RemoveMin() T

func (*Heap[T]) Size

func (heap *Heap[T]) Size() int

type PriorityQueue

type PriorityQueue[T any] struct {
	Heap *Heap[T]
}

func MakePriorityQueue

func MakePriorityQueue[T any](compare func(T, T) int) *PriorityQueue[T]

func (*PriorityQueue[T]) Clear

func (queue *PriorityQueue[T]) Clear()

func (*PriorityQueue[T]) ExtractMin

func (queue *PriorityQueue[T]) ExtractMin() T

func (*PriorityQueue[T]) Insert

func (queue *PriorityQueue[T]) Insert(value T)

func (*PriorityQueue[T]) IsEmpty

func (queue *PriorityQueue[T]) IsEmpty() bool

func (*PriorityQueue[T]) Size

func (queue *PriorityQueue[T]) Size() int

func (*PriorityQueue[T]) Top

func (queue *PriorityQueue[T]) Top() T

Jump to

Keyboard shortcuts

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