Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
list := []int{31, 41, 59, 26, 53, 58, 97, 93, 23, 84}
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
fmt.Println("unsorted:", list)
|
||||
temp := make([]int, len(list))
|
||||
copy(temp, list)
|
||||
for !sort.IntsAreSorted(temp) {
|
||||
for i, v := range rand.Perm(len(list)) {
|
||||
temp[i] = list[v]
|
||||
}
|
||||
}
|
||||
fmt.Println("sorted! ", temp)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue