mlw <[EMAIL PROTECTED]> writes:
> quicksort is a pretty poor algorithm if your data is in some kind of order
> already.

Only if you fail to take standard precautions against making a bad
choice of pivot element; every discussion I've ever seen of quicksort
explains ways to avoid that pitfall.  Solaris' problem seems to be a
more subtle issue having to do with large numbers of equal keys.  The
form of quicksort that Knuth presents is tuned to behave well in that
situation, at the cost of exchanging equal records (cf. his exercise
5.2.2.18) ... perhaps Sun overlooked that particular hack, or got it
wrong.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to