Skip to content

Instantly share code, notes, and snippets.

@Ocramius
Last active May 5, 2017 07:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Ocramius/e5c3ce7e2527958fff83e341dc2befbf to your computer and use it in GitHub Desktop.
qsort_r([]) ->
[];
qsort_r([Pivot | L]) ->
qsort_r([X || X <- L, X < Pivot]) ++
[Pivot] ++
qsort_r([X || X <- L, X >= Pivot]).
qsort_r [] =
[]
qsort_r (pivot : otherElements) =
qsort_r [x | x <- otherElements, x < pivot] ++
[pivot] ++
qsort_r [x | x <- otherElements, x >= pivot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment