algorithms

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

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 Find

func Find[T comparable](data []T, value T) int

finds the given value in the given slice

func FindIf

func FindIf[T any](data []T, predicate func(value T) bool) int

finds a value 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL