Personal tools

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, search

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]