Return to Snippet

Revision: 16751
at August 14, 2009 12:16 by narkisr


Initial Code
(defn qsort-rs [[pivot & xs]]
  (when pivot
    (let [smaller #(< % pivot)]
      (lazy-cat (qsort (filter smaller xs))
                [pivot]
                (qsort (remove smaller xs))))))

Initial URL
http://rosettacode.org/wiki/Quicksort#Clojure

Initial Description
A Functional quick sort (Java imperative version seems to be quicker).

Initial Title
Functional quick sort

Initial Tags
sort

Initial Language
Lisp