Beispiel #1
0
func main() {
	arrlen := 20
	strlen := 10
	helper.ResetTimer()
	array := helper.MakeArray(strlen, arrlen)
	t := helper.ReadTimerMilliseconds()
	fmt.Printf("Generated %d strings of length %d in %.4f ms\n",
		arrlen, strlen, t)
	for _, x := range array {
		fmt.Println(x)
	}
}
Beispiel #2
0
func main() {
	if len(os.Args) != 3 {
		fmt.Println("Usage: <strlen> <arrlen>")
		os.Exit(0)
	}
	strlen, _ := strconv.Atoi(os.Args[1])
	arrlen, _ := strconv.Atoi(os.Args[2])

	helper.ResetTimer()
	array := helper.MakeArray(strlen, arrlen)
	t := helper.ReadTimerMilliseconds()
	fmt.Printf("Sorted in %d ms\n", t)
	fmt.Println(sort(array))
}