Tobias Froehlich <re*******@gmx.net> wrote:
How can I sort an array so that the highest value has the index of 0 ?
I mean if i have a double array like this:
{ 0.1, 0.5, 0.32, 0.9 }
it should be transformed into a new array that looks like the
following::
{ 0.9, 0.5, 0.32, 0.1 }
Either use Array.Sort and then reverse it from the increasing order
you'll get out of it, or use Array.Sort and specify the comparator to
use. The former *may* be significantly faster for large arrays, as the
framework could optimise sorting arrays of primitives so that they
didn't need to be boxed/unboxed for each comparison.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too