FP Homework 4

From Marek Běhálek Wiki
Jump to navigation Jump to search

Arrays and vectors in Haskell

1 - Quicksort

  • Create a function, that sorts an array using quicksort algorithm quicksort. Inside, you must use the mutable array STArray.
quickSort :: Array Int Int -> Array Int Int
ghci> elems $ quickSort $  listArray (0,5) [8,4,9,6,7,1] 
[1,4,6,7,8,9]