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 @@
|
|||
function gnomeSort(sequence s)
|
||||
integer i,j
|
||||
object temp
|
||||
i = 1
|
||||
j = 2
|
||||
while i < length(s) do
|
||||
if compare(s[i], s[i+1]) <= 0 then
|
||||
i = j
|
||||
j += 1
|
||||
else
|
||||
temp = s[i]
|
||||
s[i] = s[i+1]
|
||||
s[i+1] = temp
|
||||
i -= 1
|
||||
if i = 0 then
|
||||
i = j
|
||||
j += 1
|
||||
end if
|
||||
end if
|
||||
end while
|
||||
return s
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue