Skip to content

Commit

Permalink
Update alt.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
giolucasd authored Feb 8, 2023
1 parent e880054 commit 658b5db
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions mc346/task02/alt.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
insertionSort :: Ord a => [a] -> [a]
insertionSort [] = []
insertionSort [x] = [x]
insertionSort (x:xs) = insert $ insertionSort xs
where insert [] = [x]
insert (y:ys)
| x < y = x : y : ys
| otherwise = y : insert ys
import Data.List (minimum, delete)

ssort :: Ord t => [t] -> [t]
ssort [] = []
ssort xs = let { x = minimum xs }
in x : ssort (delete x xs)

0 comments on commit 658b5db

Please sign in to comment.