binary

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

README

Binary Priority Queue

Implementation Notes

Nodes contain the following:

  • A key k, where k ∈ ℝ
  • A pointer to a value

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heap

type Heap[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func Merge

func Merge[K cmp.Ordered, V any](a, b *Heap[K, V]) *Heap[K, V]

func NewHeap

func NewHeap[K cmp.Ordered, V any]() *Heap[K, V]

func (*Heap[K, V]) Clear

func (h *Heap[K, V]) Clear()

func (*Heap[K, V]) FindMin

func (h *Heap[K, V]) FindMin() *Node[K, V]

func (*Heap[K, V]) Insert

func (h *Heap[K, V]) Insert(newNode *Node[K, V])

func (*Heap[K, V]) RemoveMin

func (h *Heap[K, V]) RemoveMin()

func (*Heap[K, V]) Size

func (h *Heap[K, V]) Size() int

type Node

type Node[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode[K cmp.Ordered, V any](key K, value V) *Node[K, V]

func (*Node[K, V]) Key

func (n *Node[K, V]) Key() K

func (*Node[K, V]) Value

func (n *Node[K, V]) Value() V

Jump to

Keyboard shortcuts

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