find

package
v0.0.0-...-1f453bd Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Binary

func Binary[T Number](s T, arr []T) int

Binary 二分查找, 返回检索到的下标,未检索到返回-1

s 检索值
arr 检索的 slice,必须是有序的(升序或降序的)

Types

type Float

type Float interface {
	~float32 | ~float64
}

Float 浮点数

type Integer

type Integer interface {
	Signed | Unsigned
}

Integer 整数

type Number

type Number interface {
	Integer | Float
}

Number 数字

type Ordered

type Ordered interface {
	Number | ~string
}

Ordered 数字或字符串

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Signed 有符合整数

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Unsigned 无符号整数

Jump to

Keyboard shortcuts

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