Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeapPop ¶
func HeapPop[T Number](arr *[]T) T
Pop and return the smallest item from the heap, maintaining the heap invariant. Receives a pointer from a slice Changes are made in place
func HeapPush ¶
func HeapPush[T Number](arr *[]T, val T)
Push the value item onto the heap, maintaining the heap invariant. Receives a pointer from a slice and a value to be pushed. Changes are made in place
func HeapPushPop ¶
func HeapPushPop[T Number](arr *[]T, val T) T
Push item on the heap, then pop and return the smallest item from the heap. Receives a pointer from a slice and a value to be pushed. Changes are made in place
Types ¶
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
This interface restrict variables that can be set in generics.
Click to show internal directories.
Click to hide internal directories.