Create a gist now

Instantly share code, notes, and snippets.

@j1n3l0 /gist:5323036
Last active Dec 15, 2015

(defn qsort-simple
"Quicksort - the simple algorithm"
[[pivot & tail :as coll]]
(if (> 2 (count coll))
coll
(let [less (filter (partial >= pivot) tail)
more (filter (partial < pivot) tail)]
(concat (qsort-simple less) [pivot] (qsort-simple more)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment