heap

package
v0.0.0-...-1c9a7a8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element interface{}

type ElementPtr

type ElementPtr[T Element] interface {
	schnittstellen.Ptr[T]
}

type Heap

type Heap[T Element, TPtr ElementPtr[T]] struct {
	// contains filtered or unexported fields
}

func Make

func Make[T Element, TPtr ElementPtr[T]](
	equaler schnittstellen.Equaler[T, TPtr],
	lessor schnittstellen.Lessor2[T, TPtr],
	resetter schnittstellen.Resetter2[T, TPtr],
) Heap[T, TPtr]

func MakeHeapFromSlice

func MakeHeapFromSlice[T Element, TPtr ElementPtr[T]](
	equaler schnittstellen.Equaler[T, TPtr],
	lessor schnittstellen.Lessor2[T, TPtr],
	resetter schnittstellen.Resetter2[T, TPtr],
	s []TPtr,
) Heap[T, TPtr]

func (*Heap[T, TPtr]) Add

func (h *Heap[T, TPtr]) Add(sk TPtr) (err error)

func (Heap[T, TPtr]) Copy

func (a Heap[T, TPtr]) Copy() Heap[T, TPtr]

func (Heap[T, TPtr]) Each

func (a Heap[T, TPtr]) Each(f schnittstellen.FuncIter[T]) (err error)

func (Heap[T, TPtr]) EachPtr

func (a Heap[T, TPtr]) EachPtr(f schnittstellen.FuncIter[TPtr]) (err error)

func (Heap[T, TPtr]) Equals

func (a Heap[T, TPtr]) Equals(b Heap[T, TPtr]) bool

func (*Heap[T, TPtr]) Fix

func (a *Heap[T, TPtr]) Fix()

func (*Heap[T, TPtr]) GetEqualer

func (h *Heap[T, TPtr]) GetEqualer() schnittstellen.Equaler[T, TPtr]

func (*Heap[T, TPtr]) GetLessor

func (h *Heap[T, TPtr]) GetLessor() schnittstellen.Lessor2[T, TPtr]

func (*Heap[T, TPtr]) GetResetter

func (h *Heap[T, TPtr]) GetResetter() schnittstellen.Resetter2[T, TPtr]

func (Heap[T, TPtr]) Len

func (h Heap[T, TPtr]) Len() int

func (*Heap[T, TPtr]) MergeStream

func (a *Heap[T, TPtr]) MergeStream(
	read func() (TPtr, error),
	write schnittstellen.FuncIter[TPtr],
) (err error)

func (*Heap[T, TPtr]) Peek

func (h *Heap[T, TPtr]) Peek() (sk TPtr, ok bool)

func (*Heap[T, TPtr]) Pop

func (h *Heap[T, TPtr]) Pop() (sk TPtr, ok bool)

func (*Heap[T, TPtr]) PopAndSave

func (h *Heap[T, TPtr]) PopAndSave() (sk TPtr, ok bool)

func (*Heap[T, TPtr]) PopError

func (h *Heap[T, TPtr]) PopError() (sk TPtr, err error)

func (*Heap[T, TPtr]) Push

func (h *Heap[T, TPtr]) Push(sk TPtr)

func (*Heap[T, TPtr]) Reset

func (a *Heap[T, TPtr]) Reset()

func (*Heap[T, TPtr]) ResetWith

func (a *Heap[T, TPtr]) ResetWith(b Heap[T, TPtr])

func (*Heap[T, TPtr]) Restore

func (h *Heap[T, TPtr]) Restore()

func (*Heap[T, TPtr]) SetPool

func (h *Heap[T, TPtr]) SetPool(p schnittstellen.Pool[T, TPtr])

func (*Heap[T, TPtr]) Sorted

func (a *Heap[T, TPtr]) Sorted() (b []TPtr)

Jump to

Keyboard shortcuts

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