Re: sort algorithm
- From: Juha Nieminen <nospam@xxxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 14:40:50 GMT
Limbo wrote:
i have an array of size 100000000 (100M) that was randomaly
initialized with numbers (0-100)
now, i wrote a function that sort this array in 1500 ms.
its sorts an array of 10M in 140 ms, an array of 1M in 16 ms.
my question is, is this function performance ok?
what is the Big O of this function.
is there a better function to do the same?
The best sorting algorithm for that specific case is counting sort, as
it's a linear-time sorting algorithm (ie. O(n)).
.
- References:
- sort algorithm
- From: Limbo
- sort algorithm
- Prev by Date: sort algorithm
- Next by Date: Re: sort algorithm
- Previous by thread: sort algorithm
- Next by thread: Re: sort algorithm
- Index(es):
Relevant Pages
|