heap

package
v1.12.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustDown added in v1.8.2

func AdjustDown[T cmp.Comparable[T]](heap []T, i int)

与Down一致,不同的写法

func AdjustUp added in v1.8.2

func AdjustUp[T cmp.Comparable[T]](heap []T, i int)

与Up一致,不同的写法

func Down added in v1.8.2

func Down[T cmp.Comparable[T]](heap []T, i0, n int) bool

func Fix added in v1.8.2

func Fix[T cmp.Comparable[T]](heap []T, i int)

func Init added in v1.8.2

func Init[T cmp.Comparable[T]](heap []T)

func Up added in v1.8.2

func Up[T cmp.Comparable[T]](heap []T, j int)

Types

type Heap

type Heap[T cmp.Comparable[T]] []T

func New added in v1.8.2

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

func NewFromArray added in v1.8.2

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

func (Heap[T]) First

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

func (Heap[T]) Init

func (heap Heap[T]) Init()

func (Heap[T]) Last

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

func (*Heap[T]) Pop

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

func (*Heap[T]) Push

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

func (*Heap[T]) Remove

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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