Skip to content

Commit 7da835f

Browse files
authored
Create bubbleSort.hs
1 parent e7c3172 commit 7da835f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bubbleSort :: Ord a => [a] -> [a]
2+
bubbleSort list = go list []
3+
where
4+
go [] sorted = sorted
5+
go (x:xs) (y:ys)
6+
| x > y = (x:ys) : go xs sorted
7+
| otherwise = (y:xs) : go (x:ys) sorted

0 commit comments

Comments
 (0)