heaps

package
v0.0.0-...-c62fffc Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 1 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[C cmp.Ordered] interface {
	Len() int
	Less(i, j int) bool
	Swap(i, j int)
	Push(x any)
	Pop() any
}

func NewMaxHeap

func NewMaxHeap[C cmp.Ordered]() Heap[C]

func NewMinHeap

func NewMinHeap[C cmp.Ordered]() Heap[C]

type MaxHeap

type MaxHeap[C cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func (*MaxHeap[C]) Len

func (m *MaxHeap[C]) Len() int

func (*MaxHeap[C]) Less

func (m *MaxHeap[C]) Less(i, j int) bool

func (*MaxHeap[C]) Pop

func (m *MaxHeap[C]) Pop() any

func (*MaxHeap[C]) Push

func (m *MaxHeap[C]) Push(x any)

func (*MaxHeap[C]) Swap

func (m *MaxHeap[C]) Swap(i, j int)

type MinHeap

type MinHeap[C cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func (*MinHeap[C]) Len

func (m *MinHeap[C]) Len() int

func (*MinHeap[C]) Less

func (m *MinHeap[C]) Less(i, j int) bool

func (*MinHeap[C]) Pop

func (m *MinHeap[C]) Pop() any

func (*MinHeap[C]) Push

func (m *MinHeap[C]) Push(x any)

func (*MinHeap[C]) Swap

func (m *MinHeap[C]) Swap(i, j int)

Jump to

Keyboard shortcuts

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