Re: sort algorithm
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 17:18:57 +0000
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
.
- Follow-Ups:
- Re: sort algorithm
- From: Juha Nieminen
- Re: sort algorithm
- References:
- sort algorithm
- From: Limbo
- Re: sort algorithm
- From: Richard Heathfield
- Re: sort algorithm
- From: Juha Nieminen
- sort algorithm
- Prev by Date: Re: sort algorithm
- Next by Date: Re: sort algorithm
- Previous by thread: Re: sort algorithm
- Next by thread: Re: sort algorithm
- Index(es):