On Sun, Jan 30, 2011 at 6:19 PM, Morgan Schweers <cyber...@gmail.com> wrote: > Greetings, > Ruby's sort algorithm is quicksort, last I checked, and quicksort is not > stable (which is the property you're looking for in a sort). There are a > bunch of ways around this, including writing your own, but one cute, quick, > but possibly performance-impairing, approach I've seen (Matz's suggestion) > is:
FWIW, JRuby originally had a stable Array#sort, but because it was slower than MRI's unstable sort (and we got bug reports to that effect) we replaced it with an unstable hybrid sort based on quicksort. Shortly after we did that, someone raised an issue against MRI to get it to move to a stable sort :) As far as I know, MRI hasn't changed yet. - Charlie _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel