Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap[T any] struct { // contains filtered or unexported fields }
func NewLessHeap ¶
func NewMaxHeap ¶
func NewMaxHeap[T constraints.Ordered](data ...T) *Heap[T]
func NewMinHeap ¶
func NewMinHeap[T constraints.Ordered](data ...T) *Heap[T]
type HeapInterface ¶
type LessHeap ¶
type LessHeap[T Lessable[T]] struct { OrderedHeap[T] }
type MaxHeap ¶
type MaxHeap[T constraints.Ordered] struct { OrderedHeap[T] }
type MinHeap ¶
type MinHeap[T constraints.Ordered] struct { OrderedHeap[T] }
type OrderedHeap ¶
type OrderedHeap[T any] []T
func (OrderedHeap[T]) Len ¶
func (h OrderedHeap[T]) Len() int
func (*OrderedHeap[T]) Pop ¶
func (h *OrderedHeap[T]) Pop() any
func (*OrderedHeap[T]) Push ¶
func (h *OrderedHeap[T]) Push(x any)
func (OrderedHeap[T]) Swap ¶
func (h OrderedHeap[T]) Swap(i, j int)
func (OrderedHeap[T]) Top ¶
func (h OrderedHeap[T]) Top() any
Click to show internal directories.
Click to hide internal directories.