2
0
mirror of https://github.com/0xAX/go-algorithms synced 2024-11-13 13:10:30 +00:00
go-algorithms/utils.go

14 lines
164 B
Go
Raw Normal View History

2014-06-21 16:59:23 +00:00
package utils
import "math/rand"
func RandArray(n int) []int {
arr := make([]int, n)
for i := 0; i <= n - 1; i++ {
arr[i] = rand.Intn(n)
}
return arr
}