Documentation ¶
Index ¶
- func Count[T comparable](data []T, value T) int
- func CountIf[T comparable](data []T, predicate func(value T) bool) int
- func Find[T comparable](data []T, value T) int
- func FindIf[T any](data []T, predicate func(value T) bool) int
- func MaxElement[T constraints.Ordered](data []T) T
- func MinElement[T constraints.Ordered](data []T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count[T comparable](data []T, value T) int
counts all occurrences of the given value in the given slice
func CountIf ¶
func CountIf[T comparable](data []T, predicate func(value T) bool) int
counts all occurrences of values satisfying the given predicate in the given slice
func MaxElement ¶
func MaxElement[T constraints.Ordered](data []T) T
finds a maximal value in the given slice
func MinElement ¶
func MinElement[T constraints.Ordered](data []T) T
finds a minimal value in the given slice
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.