Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Tensort.Subalgorithms.Bubblesort
Description
This module provides the bubblesort function for sorting Bit lists
Synopsis
- bubblesort :: Ord a => [a] -> [a]
Documentation
bubblesort :: Ord a => [a] -> [a] Source #
Takes a Bit and returns a sorted Bit using a Bubblesort algorithm.
Examples
>>>
bubblesort ([16, 23, 4, 8, 15, 42] :: [Int])
[4,8,15,16,23,42]
>>>
bubblesort ([(1, 16), (5, 23), (2, 4), (3, 8), (0, 15), (4, 42)] :: [(Int, Int)])
[(0,15),(1,16),(2,4),(3,8),(4,42),(5,23)]