Jump to content

Sorting algorithms/Quicksort: Difference between revisions

No edit summary
Line 503:
qsort([X|Xs]) ->
qsort([ Y || Y <- Xs, Y < X]) ++ [X] ++ qsort([ Y || Y <- Xs, Y >= X]).</lang>
 
=={{header|F_sharp|F#}}==
<lang fsharp>
let rec qsort = function
[] -> []
| x::xs ->
qsort [for a in xs do if a < x then yield a]@x::
qsort [for a in xs do if a >= x then yield a]
</lang>
 
=={{header|Factor}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.