Le 18/06/2005 01:20, dans
(e-mail address removed), « JE McGimpsey »
Not positive what you mean by "order preserving", as sorts by their very
nature change the order, but if you mean "will Bob's solution work?",
the answer is "yes".
Take a n x 2 matrix
5 7
4 8
4 5
4 3
3 6
4 4
1 2
That's just an example... If you sort according to 1st column,
and sort is "order-preserving" (maybe the term is incorrect),
then the 2nd column will still have "8, 5, 3, 4" in that order.
I mean, if several rows have same 1st column value, then
relative positions of 2nd column don't change (their order
is preserved). Not all sort algorithms do that. And bob's method
will work only if this property is true.