FP Homework 4

From Marek Běhálek Wiki
Revision as of 13:16, 4 November 2022 by Beh01 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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]