[futurebasic] Quick Sort for Numbers?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Robert Covington <t88@...>
Date: Tue, 8 Jun 1999 08:57:31 -0800
Do anybody have anything that will do for numbers what Tedd's quicksort
does for strings?

I need to be able to sort up to 250,000 values from smallest to largest.

I have an array of XYZ points needing to be sorted by Z's, and I was
thinking that my ZBuf array (array 2) could just store a pointer to the
element of the array (the N,j,i, whatever) instead of my having to have a
whole array to copy all the points over to in order.

So for example, if XYZ.Z(3) is "24" and XYZ.Z(4) is "7" the other array
would have data of 4,3,... so on (unless something was inbetween those of
course). I can just cross reference the pointer to the original array data
when plotting the points. But I guess it might still take a secondary array
to hold things temporarily for the sort.

Anything that would work quickly for this high amount of numbers would be
nice no matter what the setup though. I tried the FB Bubble sort, but it
took about 6 years to do 250,000 points. Heck, it took 6 years to do just
50,000 points.

Robert Covington