Documentation ¶
Overview ¶
Package search implements an elementary binary search algorithm for types that satisfy golang.org/x/exp/constraints.Ordered.
It provides an alternative to the standard library's sort.Search and sort.Find.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexOf ¶
func IndexOf[T constraints.Ordered](a []T, v T) int
IndexOf returns the index of the specified key v in the slice a or -1 otherwise. The elements in a should be sorted in ascending order.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.