heap

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 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 Heap

type Heap[E any] struct {
	Slice []E
	Less  func(E, E) bool
}

func New

func New[E any](less func(E, E) bool, items ...E) *Heap[E]

func (*Heap[E]) Fix

func (h *Heap[E]) Fix(i int)

func (*Heap[E]) Len

func (h *Heap[E]) Len() int

func (*Heap[E]) Peek

func (h *Heap[E]) Peek() E

func (*Heap[E]) Pop

func (h *Heap[E]) Pop() E

func (*Heap[E]) Push

func (h *Heap[E]) Push(item E)

func (*Heap[E]) Remove

func (h *Heap[E]) Remove(i int) E

Jump to

Keyboard shortcuts

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