algorithms

package
v0.0.0-...-6c0d317 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinarySearch

func BinarySearch[T algorithms.Ordered](values []T, target T) int

return -1 of array if not found the target,result is different with sort.SearchInts 没有搜索到目标返回-1 与sort.SearchInts()行为不同,sort.SearchInts()返回元素插入位置,可能是len(values)

Types

type SearchStringTestCase

type SearchStringTestCase struct {
	// contains filtered or unexported fields
}

type SearchTestCase

type SearchTestCase struct {
	// contains filtered or unexported fields
}

搜索测试用例

Jump to

Keyboard shortcuts

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