Data Type question / Sort

From: Marston (marston_gould_at_mac.com)
Date: 08/12/04


Date: 11 Aug 2004 17:45:22 -0700

Hi

I'm trying to prep some values for a multi-column sort in an array.
The array contains something like 300,000 by 10 values
I've seen quick sort routines that can sort on a single value, but not
perform sorts within the initial sort.

My idea was to concatenate all my values into a single value and then
sort on it. The problem I'm facing is that my numbers would have to be
on the order of ~10E+18-1 long

The way the routine works is it looks at the numbers in each column
whose length is fixed and never has a situation where there are
leading zeros to cause problems.

       Col 1 Col 2 Col 3 Col 4 Col 5 Col 6
Row x: aaa bbb cc ddddd e fff

I only need to arrange based on these 6 columns not the entire 10 in
the array

My problem is when I create a number like aaabbbccdddddefff it appears
to have
problems with the "efff" portion. I checked each individual component
(which I'm multiplying by some 1nnnn where n is some number of zeros -
and they all work fine, its just once I tried to add things. Its like
it drops values off.
I have the variables defined as Double which I thought would work.

Any thoughts?



Relevant Pages

  • Re: "Sorting" assignment
    ... And many others prefer to call partition exchange because "quicksort" ... bin B depending on whether it is greater than, ... If the array is already sorted, this means that you end up ... attempt to sort them. ...
    (comp.programming)
  • Re: A Fast sorting algorithm for almost sorted data
    ... far my compressor has potential but is nowhere near ready. ... It does however make heavy use of sorting. ... which I am currently calling Run sort. ... entire selected run can be added to the sorted output array. ...
    (comp.compression)
  • A Fast sorting algorithm for almost sorted data
    ... which I am currently calling Run sort. ... entire selected run can be added to the sorted output array. ... public class RunSort implements Comparator ... public static void sort(Comparable a, int start,int end) ...
    (comp.compression)
  • Re: Save & Sort
    ... You can copy your array to a scratch ... "Heap" sort. ... Dim lst As Long ... Dim tmp As String ...
    (microsoft.public.excel.programming)
  • Re: fast stable sort
    ... if you have an existing array, you can simply arrange an array of ... pointers to the items, and sort that. ... hence require swapping pages of virtual memory, ... each merge run instead of accessing them in sequential RAM ...
    (comp.programming)