heapparam

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fix

func Fix[T any](h Interface[T], i int)

Fix wraps h to make it compatible with `container/heap` then call `container/heap`.Fix with it.

func Init

func Init[T any](h Interface[T])

Init wraps h to make it compatible with `container/heap` then call `container/heap`.Init with it.

func Pop

func Pop[T any](h Interface[T]) (v T)

Pop wraps h to make it compatible with `container/heap` then call `container/heap`.Pop with it. If internal Pop returns nil value, this Pop returns zero-value for T.

func Push

func Push[T any](h Interface[T], x T)

Push wraps h to make it compatible with `container/heap` then call `container/heap`.Push with it.

func Remove

func Remove[T any](h Interface[T], i int) (v T)

Remove wraps h to make it compatible with `container/heap` then call `container/heap`.Remove with it. If internal Remove returns nil value, this Remove returns zero-value for T.

Types

type Interface

type Interface[T any] interface {
	sort.Interface
	Push(x T)
	Pop() T
}

Interface is same as `container/heap`.Interface but uses type-param

Jump to

Keyboard shortcuts

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