Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,9 +1,9 @@
|
|||
gnomeSort [] = []
|
||||
gnomeSort (x:xs) = gs [x] xs
|
||||
where
|
||||
gs vv@(v:vs) (w:ws)
|
||||
| v<=w = gs (w:vv) ws
|
||||
| otherwise = gs vs (w:v:ws)
|
||||
gs [] (y:ys) = gs [y] ys
|
||||
gs xs [] = reverse xs
|
||||
gs vv@(v:vs) (w:ws)
|
||||
| v<=w = gs (w:vv) ws
|
||||
| otherwise = gs vs (w:v:ws)
|
||||
gs [] (y:ys) = gs [y] ys
|
||||
gs xs [] = reverse xs
|
||||
-- keeping the first argument of gs in reverse order avoids the deterioration into cubic behaviour
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue