all: updateimport () and []array

This commit is contained in:
yuyi 2020-04-26 19:49:31 +08:00 committed by GitHub
parent 7b39ab6d06
commit 9f4d498ff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 181 additions and 254 deletions

View file

@ -9,7 +9,7 @@ const (
fn main() {
rand.seed(time.now().unix)
rand.next(MAX) // skip the first
mut arr := []int
mut arr := []int{}
for _ in 0..LEN {
arr << rand.next(MAX)
}
@ -33,7 +33,7 @@ fn quick_sort(arr mut []int, l int, r int) {
quick_sort(mut arr, sep+1, r)
}
[inline]
[inline]
fn swap(arr mut []int, i int, j int) {
temp := arr[i]
arr[i] = arr[j]