heap

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 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 interface {
	Size() int
	IsEmpty() bool
	Insert(Generic, Generic)
	Delete() (Generic, Generic)
	Peek() (Generic, Generic)
	ContainsKey(Generic) bool
	ContainsValue(Generic) bool
}

Heap represents a heap (priority queue) data structure

func NewMaxHeap

func NewMaxHeap(initialSize int, compareKey, compareValue Compare) Heap

NewMaxHeap creates a new max-heap (priority queue)

func NewMinHeap

func NewMinHeap(initialSize int, compareKey, compareValue Compare) Heap

NewMinHeap creates a new min-heap (priority queue)

Jump to

Keyboard shortcuts

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