thinheap

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package thinheap implements a thin heap. See http://www.cs.tau.ac.il/~haimk/papers/newthin1.pdf for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node[T constraints.Ordered] struct {
	// contains filtered or unexported fields
}

type ThinHeap

type ThinHeap[T constraints.Ordered] struct {
	// contains filtered or unexported fields
}

ThinHeap represents a thin heap. Zero value of ThinHeap is empty ThinHeap.

func New

func New[T constraints.Ordered]() *ThinHeap[T]

New returns empty ThinHeap.

func (*ThinHeap[T]) DeleteMin

func (h *ThinHeap[T]) DeleteMin() T

DeleteMin delete minimal element from heap and return it.

func (*ThinHeap[T]) Insert

func (h *ThinHeap[T]) Insert(element T)

Insert inserts elements into heap.

func (*ThinHeap[T]) Min

func (h *ThinHeap[T]) Min() T

Min returns minimal element.

func (*ThinHeap[T]) Size

func (h *ThinHeap[T]) Size() int

Size returns size of heap.

Jump to

Keyboard shortcuts

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