Re: sort algorithm



Juha Nieminen said:

Richard Heathfield wrote:
I used bucket-sort. For this application, I heartily recommend it.

Wouldn't a simple counting sort have been much simpler to implement
(and probably faster)?

Um, what you call counting sort, I call bucket sort. I'm probably abusing
the term.

<snip>

The speed of this depends heavily on the actual integral type used in
the array. For example in my computer (3.4GHz Pentium4) sorting an array
of ints like this takes about 400ms, but if it's an array of chars
instead, it takes only 170ms.

Ah, it seems that you have a much faster computer than I do. A much, much,
MUCH faster computer, in fact. Either that or I accidentally tucked a
busy-wait into the loop. :-)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.