heap

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MulanPSL-2.0 Imports: 2 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[T any] struct {
	// contains filtered or unexported fields
}

func NewHeap

func NewHeap[T any](less func(T, T) bool) *Heap[T]

func NewHeapData added in v0.2.4

func NewHeapData[T any](d []T, less func(T, T) bool) *Heap[T]

func (*Heap[T]) Fix added in v0.2.4

func (h *Heap[T]) Fix(i int, v T)

func (*Heap[T]) Len

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

func (*Heap[T]) Pop

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

func (*Heap[T]) Push

func (h *Heap[T]) Push(v T)

func (*Heap[T]) Remove

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

func (*Heap[T]) Sort

func (h *Heap[T]) Sort()

func (*Heap[T]) Top

func (h *Heap[T]) Top() T

Jump to

Keyboard shortcuts

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