Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
F bubble_sort(&seq)
|
||||
V changed = 1B
|
||||
L changed == 1B
|
||||
changed = 0B
|
||||
L(i) 0 .< seq.len - 1
|
||||
I seq[i] > seq[i + 1]
|
||||
swap(&seq[i], &seq[i + 1])
|
||||
changed = 1B
|
||||
|
||||
V testset = Array(0.<100)
|
||||
V testcase = copy(testset)
|
||||
random:shuffle(&testcase)
|
||||
assert(testcase != testset)
|
||||
bubble_sort(&testcase)
|
||||
assert(testcase == testset)
|
||||
Loading…
Add table
Add a link
Reference in a new issue