Sorting routines

Bill Baxter dnewsgroup at billbaxter.com
Thu Mar 6 19:08:20 PST 2008


Anyone have a sort routine that can operate simultaneously on multiple 
arrays of data?

It's basically a lexical sort kind of thing, but all the keys and values 
are in different arrays:
int[] key1;
int[] key2;
ValueT1[] values;
ValueT2[] other_values;

Datum i is made up of (key1[i],key2[i],values[i],other_values[i]).

But they're all stored in separate arrays rather than interleaved in a 
struct.

The goal is to avoid copying the whole mess to an interleaved array in 
order to sort it, and then copying it back to separate arrays.

--bb


More information about the Digitalmars-d-learn mailing list