search

package
v0.0.0-...-722f337 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinearSearch

func LinearSearch[T comparable](arr []T, target T) (int, error)

find minimum index i such that arr[i] == target

func LowerBound

func LowerBound[T cmp.Ordered](arr []T, target T) (int, error)

use binary search to find the first element that is not less than target

func UpperBound

func UpperBound[T cmp.Ordered](arr []T, target T) (int, error)

use binary search to find the first element that is greater than target

Types

This section is empty.

Jump to

Keyboard shortcuts

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