heap

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedCapHeap

type FixedCapHeap[T any, V Interface[T]] Heap[T, V]

func NewFixedCapHeap

func NewFixedCapHeap[T any, V Interface[T]](arr V) FixedCapHeap[T, V]

func (FixedCapHeap[T, V]) Put

func (heap FixedCapHeap[T, V]) Put(val T)

type Heap

type Heap[T any, V Interface[T]] []T

func NewHeap

func NewHeap[T any, V Interface[T]](arr V) Heap[T, V]

func (Heap[T, V]) First

func (heap Heap[T, V]) First() T

func (Heap[T, V]) Init

func (heap Heap[T, V]) Init()

func (Heap[T, V]) Last

func (heap Heap[T, V]) Last() T

func (*Heap[T, V]) Pop

func (heap *Heap[T, V]) Pop() T

func (*Heap[T, V]) Push

func (heap *Heap[T, V]) Push(x T)

func (*Heap[T, V]) Remove

func (heap *Heap[T, V]) Remove(i int) T

type Heap2

type Heap2[T Interface2[T]] []T

func NewHeap2

func NewHeap2[T Interface2[T]](arr []T) Heap2[T]

type Interface

type Interface[T any] interface {
	~[]T
	Less(i, j int) bool
}

type Interface2

type Interface2[T any] interface {
	Less(v T) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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