Documentation ¶
Index ¶
- type Heap
- func From[V any](data []V, cmp structs.CompareFunc[V]) *Heap[V]
- func FromHeapSlice[V any](data []V, cmp structs.CompareFunc[V]) *Heap[V]
- func FromOrdered[V constraints.Ordered](data []V) *Heap[V]
- func FromOrderedHeapSlice[V constraints.Ordered](data []V) *Heap[V]
- func New[V any](cmp structs.CompareFunc[V]) *Heap[V]
- func NewCap[V any](capacity int, cmp structs.CompareFunc[V]) *Heap[V]
- func NewOrdered[V constraints.Ordered]() *Heap[V]
- func NewOrderedCap[V constraints.Ordered](capacity int) *Heap[V]
- func (h *Heap[V]) Clear()
- func (h *Heap[V]) Contains(value V) bool
- func (h *Heap[V]) Index(value V) int
- func (h *Heap[V]) IsEmpty() bool
- func (h *Heap[V]) Peek() V
- func (h *Heap[V]) Pop() V
- func (h *Heap[V]) Push(value V)
- func (h *Heap[V]) Remove(value V) bool
- func (h *Heap[V]) RemoveIndex(i int) V
- func (h *Heap[V]) SetCapFunc(capFn structs.CapacityFunc)
- func (h *Heap[V]) Size() int
- func (h *Heap[V]) Update(oldValue, newValue V) bool
- func (h *Heap[V]) UpdateIndex(i int, newValue V)
- func (h *Heap[V]) Values() []V
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap[V any] struct { // contains filtered or unexported fields }
func FromHeapSlice ¶
func FromHeapSlice[V any](data []V, cmp structs.CompareFunc[V]) *Heap[V]
func FromOrdered ¶
func FromOrdered[V constraints.Ordered](data []V) *Heap[V]
func FromOrderedHeapSlice ¶
func FromOrderedHeapSlice[V constraints.Ordered](data []V) *Heap[V]
func NewOrdered ¶
func NewOrdered[V constraints.Ordered]() *Heap[V]
func NewOrderedCap ¶
func NewOrderedCap[V constraints.Ordered](capacity int) *Heap[V]
func (*Heap[V]) RemoveIndex ¶
func (*Heap[V]) SetCapFunc ¶
func (h *Heap[V]) SetCapFunc(capFn structs.CapacityFunc)
func (*Heap[V]) UpdateIndex ¶
Click to show internal directories.
Click to hide internal directories.