Quicksort

From HaskellWiki
Revision as of 23:07, 19 December 2006 by Ha$kell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Cel mai simplu limbaj si cea mai scurta implementare de algoritm Quicksort
se poate face in Haskell astfel:

quick :: [Integer] -> [Integer]
quick [] = []
quick (h:t)= quick [ y | y <- t , y < h] ++ [h] ++ quick [ y | y <- t , y > h]