Eytzinger binary search, minimalistic implementation.
Package eytzinger implements Eytzinger Binary Search, using generics to operate on any ordered type.
$ go get github.com/gammazero/eytzinger
a := make([]int, 100)
for i := 0; i < len(a); i++ {
a[i] = i
}
// Sort slice into Eytzinger order.
eytzinger.Sort(a)
// Find some numbers.
for _, find := range []int{13, 17, 19, 23, 29, 37, 73} {
index := eytzinger.Search(a, find)
fmt.Println(find, "is at index", index)
}