- View Source--- In rapidq@yahoogroups.com, "msca53" <msca53@...> wrote:
>

After having tested a total of 10 sorting routines...

> --- In rapidq@yahoogroups.com, "Don" <don67geo@> wrote:

> >

> > --- In rapidq@yahoogroups.com, "burkleyd" <burkleyd@> wrote:

> > >

> > > I found this webpage that gives examples of all

> > > 8 sorting methods... but it is written in Pascal.

> > > From what I've seen... it wouldn't (shouldn't)

> > > be too hard to convert the coding to RapidQ code.

> > >

> > > http://www.csd.net/~cgadd/knowbase/SORTING0055.HTM

> > >

> > > Hope this helps you in some way.

> > > David

> > >

> > '(*--------------- U S E R I N T E R F A C E --------------*)

> >

> > sub GetSortMethod

> > cls

> > print

> > print " CHOOSE: "

> > print

> > print " [1] FOR SELECT SORT "

> > print " [2] FOR INSERT SORT "

> > print " [3] FOR BUBBLE SORT "

> > print " [4] FOR SHAKE SORT "

> > print " [5] FOR HEAP SORT "

> > print " [6] FOR QUICK SORT "

> > print " [7] FOR SHELL SORT "

> > print " [8] FOR RADIX SORT "

> > print " [9] TO EXIT ALLSORT "

>

> Heap Sort..! Uh.. First time i read it

> Now, where is Merge Sort..?

>

> > sub StrSelectSort(X() as integer, N as integer)

> > defint I, J, K, Y

> > for I = 1 to N-1

> > K = I

> > Y = X(I)

> > for J = (I + 1) to N

> > if (X(J) < Y) then

> > K = J

> > Y = X(J)

> > end if

> > next

> > X(K) = X(J)

> > X(I) = Y

> > ShowOutput

> > print

> > next

> > end sub

> > greetings,

> >

> > - Don.

> >

> Change: X(K) = X(J) to X(K) = X(I)

>

> Good work..

> Manuel C

>

my recommendation is to use... either RapidQ's QuickSort

or RapidQ's QSringList Sort. I realize that it "might"

be a bit difficult to write the code you need for your

specific use but... they are by far the fastest.

As an example... I created a list of 666 different random

numbers. Keyword being... different. I gave it a range of

0 to 999 to choose from. After the list was generated...

both RapidQ's QuickSort (for the numeric sort test) and

RapidQ's QStringList Sort (for the alpha sort test)...

were able to sort the list in as little as 0.002 secs.!

Whereas the other 8 sorting routines took anywhere from

0.9860 secs. to 2.181 secs. to complete. Quite a substantial

difference... wouldn't you say? I don't know about you but

I am quite impressed by how low the sort times are for the

RapidQ's sorting methods. I know which sorting routines I'll

be using from now on. :)

David - View Sourcemsca53 wrote:
>> 20+ (0.02 secs. vs 0.1+ secs.) faster with my "slow" PentiumI,

...

> against

>> the 12+ seconds from QSRQ.. Obviously RapidQ slow-down the job..

> RQ's

>> quicksort() function it's a very good one..

> Ooohh.. 0.12/0.02. Sorry

And the first result is 5 and not 20 :), the second result is

> Manuel C.

6 times faster.

Jacques