Contents

sort

Ints

對 int slice 做排序

sort.Ints(arr)

IntsAreSorted

回傳 true / false 判斷 int slice 是否已經排序

func IntsAreSorted(arr []int) bool

Float64s

對 float slice 做排序

func Float64s(a []float64)

Strings

對 string slice 做排序

func Strings(a []string)

SearchInts

已經排序好的 int arry 做搜尋

回傳 index

func SearchInts(a []int, n int) int

SearchFloat64s

func SearchFloat64s(a []float64, x float64) int // search for float64 

SearchStrings

func SearchStrings(a []string, x string) int // search for strings