heapq

package
v0.0.0-...-9665b4c Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeapQueue

type HeapQueue[T comparable] struct {
	// contains filtered or unexported fields
}

Like the heap construct, but with generic types and an upsert operation.

func New

func New[T comparable]() *HeapQueue[T]

func (HeapQueue[T]) Len

func (h HeapQueue[T]) Len() int

func (HeapQueue[T]) Less

func (h HeapQueue[T]) Less(i, j int) bool

func (*HeapQueue[T]) Pop

func (h *HeapQueue[T]) Pop() interface{}

func (*HeapQueue[T]) PopSafe

func (h *HeapQueue[T]) PopSafe() T

func (*HeapQueue[T]) Push

func (h *HeapQueue[T]) Push(x interface{})

func (*HeapQueue[T]) Swap

func (h *HeapQueue[T]) Swap(i, j int)

func (*HeapQueue[T]) Upsert

func (h *HeapQueue[T]) Upsert(n T, score int)

Jump to

Keyboard shortcuts

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