Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Heap ¶
type Heap[T any] struct { // contains filtered or unexported fields }
func NewHeap ¶
NewHeap creates a new Heap using the given less function for ordering. To create a min or a max heap, adjust the less function accordingly. For example,
h := NewHeap(func(a, b int) bool { return a < b })
to create a new min heap using the int type. And logically
h := NewHeap(func(a, b int) bool { return a > b })
for a max heap.
func NewOrderedHeap ¶
NewOrderedHeap creates a new Heap using NewHeap with the default less function for the given cmp.Ordered type.
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func (*Set[T]) ContainsAll ¶
Click to show internal directories.
Click to hide internal directories.