Dec 08 2008

How To Sort Parallel Arrays in C# .NET

Published by Matt at 4:24 pm under Technology

I found a very help function today that will easily sort two parallel arrays where one of them contains a set of keys and the other stores another piece of data.  If you want the keys array to be sorted, and the other array to maintain it’s parallism, you can use the Array.Sort(Array, Array) function in .NET.

This is really nice if you have two primitive arrays that you are using in this fashion and do not want to implement your own sorting routine.

No responses yet

Trackback URI | Comments RSS

Leave a Reply