heap

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 3 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 cmp.Comparable[T]] struct {
	// contains filtered or unexported fields
}

func New

func New[T cmp.Comparable[T]](l int) Heap[T]

func NewFromArray

func NewFromArray[T cmp.Comparable[T]](arr []T) Heap[T]

func (*Heap[T]) First

func (h *Heap[T]) First() (T, bool)

func (*Heap[T]) Init

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

func (Heap[T]) Last

func (h Heap[T]) Last() (T, bool)

func (*Heap[T]) Pop

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

func (*Heap[T]) Push

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

func (*Heap[T]) Remove

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

Jump to

Keyboard shortcuts

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