Skip to content

Instantly share code, notes, and snippets.

@notyy
Created October 25, 2011 16:12
Show Gist options
  • Save notyy/1313294 to your computer and use it in GitHub Desktop.
Save notyy/1313294 to your computer and use it in GitHub Desktop.
quicksort in lisp
user=> (defn qs [l]
(if (< (count l) 2) l
(let [left (filter #(< % (first l)) (rest l))
right (filter #(>= % (first l)) (rest l))]
(concat left (list (first l)) right))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment