Skip to content

Instantly share code, notes, and snippets.

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