Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
F cocktailSort(&A)
|
||||
L
|
||||
L(indices) ((0 .< A.len-1).step(1), (A.len-2 .. 0).step(-1))
|
||||
V swapped = 0B
|
||||
L(i) indices
|
||||
I A[i] > A[i + 1]
|
||||
swap(&A[i], &A[i + 1])
|
||||
swapped = 1B
|
||||
I !swapped
|
||||
R
|
||||
|
||||
V test1 = [7, 6, 5, 9, 8, 4, 3, 1, 2, 0]
|
||||
cocktailSort(&test1)
|
||||
print(test1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue