Robert Klemme wrote in post #959935:

> No, Michael is right.  Every sorting algorithm only ever looks at *sort
> keys*.  So since our sort key is the second array member (the number)
> both mentioned records are equivalent.

Coming back to the beginning, quicksort correctly coded is stable (cut 
recursively in three parts, with the middle part made by those elements 
equivalent to the choosen pivot). Even the parallel version is stable. 
In NESL :

function quicksort(a) =
if (#a < 2) then a
else
  let pivot   = a[#a/2];
      lesser  = {e in a| e < pivot};
      equal   = {e in a| e == pivot};
      greater = {e in a| e > pivot};
      result  = {quicksort(v): v in [lesser,greater]};
  in result[0] ++ equal ++ result[1];

Which means that ruby's is badly coded.
_md

-- 
Posted via http://www.ruby-forum.com/.