but loop/recur for the partition could try to reuse as much of an existing structure as possible and then be quite nice as things get gc'd early on. Mergesort uses a lot of temporary space as things move along. Yes I like mergesort. folks already helped me get that one going.
On Thu, Jan 15, 2009 at 12:59 PM, James Reeves <weavejes...@googlemail.com>wrote: > > On Jan 15, 1:37 pm, e <evier...@gmail.com> wrote: > > What would be a good way to implement quicksort in clojure (or any > > persistent language)? > > Lennart Augustsson's point is that destructive updates are part of the > Quicksort algorithm. If we accept that, then you'd want to use a plain > old java array in your algorithm. > > Personally, I'd be inclined to use mergesort in a functional > programming language. It's easier to implement, easier to parallize > and better with linked lists. > > - James > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---