Mattias Waldau wrote:
>
> Nice suggestions changing the data structure, but I can't change it.
>
> Instead, I implemented the indirection trick by Max Skaller. However instead
> of finding how to reorder the data, I just use a temporary data structure
> instead.
That's easiest, but it would be nice to find a fast way to reorder
the array in place, in case you get very large arrays, where
constructing a new one would exhaust memory, or slow down
the process due to the VM thrashing the disk.
--
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net