There was an error while loading. Please reload this page.
1 parent e7c3172 commit 7da835fCopy full SHA for 7da835f
algorithms/Haskell/BubbleSort/bubbleSort.hs
@@ -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