Skip to content

Instantly share code, notes, and snippets.

@apg
Created January 7, 2011 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apg/769825 to your computer and use it in GitHub Desktop.
Save apg/769825 to your computer and use it in GitHub Desktop.
qsort
(defn qsort
[[x & r]]
(let [xs #(for [y r :when (% y x)] y)]
(when x
(concat (qsort (xs <=)) [x] (qsort (xs >))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment