priorityqueue

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 2 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinHeap

type BinHeap[T Item] struct {
	// contains filtered or unexported fields
}

func NewBinHeap

func NewBinHeap[T Item](maxLen uint64) *BinHeap[T]

func (*BinHeap[T]) ExtractMin

func (bh *BinHeap[T]) ExtractMin() T

func (*BinHeap[T]) Insert

func (bh *BinHeap[T]) Insert(item T)

func (*BinHeap[T]) Len

func (bh *BinHeap[T]) Len() uint64

type Item

type Item interface {
	// Priority returns the Item's priority to sort
	Priority() int64
}

Item represents binary heap item

Jump to

Keyboard shortcuts

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