heap

package
v0.0.0-...-3948e75 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinInts

type MinInts struct {
	// contains filtered or unexported fields
}

MinInts is a min-heap of integers.

func NewMinInts

func NewMinInts() *MinInts

NewMinInts builds an empty integer min-heap.

func (*MinInts) Empty

func (h *MinInts) Empty() bool

Empty returns whether the heap is empty.

func (*MinInts) Len

func (h *MinInts) Len() int

Len returns the number of elements in the heap.

func (*MinInts) Min

func (h *MinInts) Min() int

Min returns the min value without removing it.

func (*MinInts) Nums

func (h *MinInts) Nums() []int

Nums returns all the elements in the heap in no particular order.

func (*MinInts) Pop

func (h *MinInts) Pop() int

Pop the min element from the heap.

func (*MinInts) Push

func (h *MinInts) Push(x int)

Push x onto the heap.

Jump to

Keyboard shortcuts

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