Skip to content

Instantly share code, notes, and snippets.

@tcoupland
Created June 13, 2012 16:39
Show Gist options
  • Save tcoupland/2925185 to your computer and use it in GitHub Desktop.
Save tcoupland/2925185 to your computer and use it in GitHub Desktop.
Quicksort in Code Golf
(defn f [s p v] (filter #(s % p) v))
(defn s [w]
(if-let [p (first w)]
(if-let [v (rest w)]
(concat (s (f < p v)) [p] (s (f >= p v)))
p)
()
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment