Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
m (→{{header|AppleScript}}: →Straightforward: Tidied.) |
|||
Line 3,511: | Line 3,511: | ||
qsort :: Ord a => [a] -> [a] |
qsort :: Ord a => [a] -> [a] |
||
qsort [] = [] |
qsort [] = [] |
||
qsort (x:xs) = qsort ys ++ x |
qsort (x:xs) = qsort ys ++ [x] ++ qsort zs where |
||
where |
|||
(ys, zs) = partition (< x) xs</lang> |
(ys, zs) = partition (< x) xs</lang> |
||