Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2010 22:22
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 anonymous/268915 to your computer and use it in GitHub Desktop.
Save anonymous/268915 to your computer and use it in GitHub Desktop.
(defn qsort[col]
(if (seq col)
(let [x (first col) c (rest col)]
((let [y (qsort (filter #(< x %) c) )
z (qsort (filter #(>= x %) c) ) ]
(lazy-cat y (cons x z )))
)) col))
(qsort [ 1 2 3 ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment