search

package module
v0.0.0-...-0c4ec96 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: ISC Imports: 1 Imported by: 0

README

Go Reference Continuous Integration

Implements an elementary binary search.

go get tshaka.dev/x/search

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.

Jump to

Keyboard shortcuts

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