heap

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 0 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[E any, I Interface[E]] []E

func New

func New[E any, I Interface[E]](capacity int) Heap[E, I]

func NewFromArr

func NewFromArr[E any, I Interface[E]](arr I) Heap[E, I]

func (Heap[E, I]) First

func (heap Heap[E, I]) First() (E, bool)

func (Heap[E, I]) Init

func (heap Heap[E, I]) Init()

func (Heap[E, I]) Last

func (heap Heap[E, I]) Last() (E, bool)

func (*Heap[E, I]) Pop

func (heap *Heap[E, I]) Pop() (E, bool)

func (*Heap[E, I]) Push

func (heap *Heap[E, I]) Push(x E)

func (*Heap[E, I]) Put

func (heap *Heap[E, I]) Put(val E)

func (*Heap[E, I]) Remove

func (heap *Heap[E, I]) Remove(i int) (E, bool)

func (Heap[E, I]) Size

func (heap Heap[E, I]) Size() int

type Interface

type Interface[T any] interface {
	~[]T
	Less(i, j int) bool
}

Jump to

Keyboard shortcuts

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