Blitz (208/218)

From:Steve Hargreaves
Date:31 Aug 2001 at 23:46:28
Subject:Re: Sorting

On 31-Aug-01, Frederic Laboureur said -

>FL Better use the NCS sort routine (they don't crash) and are very fast.. I
>FL guess you even can't beat them :). Event original ACID sort routines are
>FL fast (Quicksort based I guess). The only way to beat NCS one is to use
>FL another algorythm (I think than using the RADIX sort algo will be even
>FL faster for small arrays (less than 256 elements)).

I'll check them out. My own routine is sort of based on a bubble algorithm, but
it sorts from both ends of the array at the same time, and quits when no swaps
are made.

By working from both ends I reduced a sort of a 192k textfile index from 58 secs on my
'060, to just 7 secs.

For interested parties, there is quite a good explanation of various sort
algorithms, together with details of their efficiency in different situations at

http://www.sparknotes.com/cs/sorting/.dir

The speakers notes are where the information is (and not in the algorithms
sections as you'd expect).

There is also a test for you to try out your knowledge (I didn't do too bad, 75%
on my first go, and it's been 20 years since I studied sorting algorithms :o)

Regards

Steve
========================================================
//Amiga 1200, '060/50, OS3.9, EZ-Tower, Dopus,
// PC Keyboard W EZ-Key, 56K modem, 2+32 Meg,
\\ // NEC 2A Multisync, Logic 3 SpeedMouse, HPDJ610C,
\\/ Sega Controller, & no hair.

=========================================================
The whole problem can be stated quite simply by asking, "Is there a meaning to music?" My answer would be, "Yes." And "Can you state in so many words what the meaning is?" My answer to that would be, "No."
-- Aaron Copland

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie