heap

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 5 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[T any] interface {
	/*

	 */
	Add(e ...T)

	/*

	 */
	Extract() (T, error)

	/*

	 */
	Clear()

	/*

	 */
	Iterator() iterator.Iterator[T]

	/*

	 */
	Delete() error

	/*

	 */
	Size() int64

	/*

	 */
	IsEmpty() bool
}

type MaxHeap

type MaxHeap[T any] struct {
	// contains filtered or unexported fields
}

func NewMaxHeap

func NewMaxHeap[T any](c comparator.Comparator[T], data ...T) *MaxHeap[T]

func (MaxHeap) Add

func (bh MaxHeap) Add(data ...T)

func (MaxHeap) Clear

func (bh MaxHeap) Clear()

func (MaxHeap) Delete

func (bh MaxHeap) Delete() error

func (MaxHeap) Extract

func (bh MaxHeap) Extract() (T, error)

func (MaxHeap) IsEmpty

func (bh MaxHeap) IsEmpty() bool

func (MaxHeap) Iterator

func (bh MaxHeap) Iterator() iterator.Iterator[T]

func (MaxHeap) Size

func (bh MaxHeap) Size() int64

type MinHeap

type MinHeap[T any] struct {
	// contains filtered or unexported fields
}

func NewMinHeap

func NewMinHeap[T any](c comparator.Comparator[T], data ...T) *MinHeap[T]

func (MinHeap) Add

func (bh MinHeap) Add(data ...T)

func (MinHeap) Clear

func (bh MinHeap) Clear()

func (MinHeap) Delete

func (bh MinHeap) Delete() error

func (MinHeap) Extract

func (bh MinHeap) Extract() (T, error)

func (MinHeap) IsEmpty

func (bh MinHeap) IsEmpty() bool

func (MinHeap) Iterator

func (bh MinHeap) Iterator() iterator.Iterator[T]

func (MinHeap) Size

func (bh MinHeap) Size() int64

Jump to

Keyboard shortcuts

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