Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
F combsort(&input)
|
||||
V gap = input.len
|
||||
V swaps = 1B
|
||||
L gap > 1 | swaps
|
||||
gap = max(1, Int(gap / 1.25))
|
||||
swaps = 0B
|
||||
L(i) 0 .< input.len - gap
|
||||
V j = i + gap
|
||||
I input[i] > input[j]
|
||||
swap(&input[i], &input[j])
|
||||
swaps = 1B
|
||||
|
||||
V y = [88, 18, 31, 44, 4, 0, 8, 81, 14, 78, 20, 76, 84, 33, 73, 75, 82, 5, 62, 70]
|
||||
combsort(&y)
|
||||
assert(y == sorted(y))
|
||||
print(y)
|
||||
Loading…
Add table
Add a link
Reference in a new issue