Is there native C # support for index sorting?
More details:
I have several datasets stored in separate shared double lists. These lists are always equal in length and contain the corresponding data elements, but these lists come and go dynamically, so I cannot just neatly store the corresponding data elements in a class or structure. (I am also dealing with some obsolete issues.)
I need to be able to sort these keys from any of the data sets.
My idea of the best way to do this is to add one level of indirection and use index sorting. Such species have been used for many years.
Quick definition of sorting by index :
make "index", an array of consecutive integers of the same length as the lists, then the sorting algorithm sorts the list of integers, so anylist[index[N]] gives the Nth element of any list in sorted order. The lists themselves are never reordered.
Is there native C # support for index sorting? I could not find it ... everything I found reorders the collection itself. I assume that support exists, but I have not looked in the right place yet.
I am using C # .NET 3.5 under Windows.
sorting c # indexing
Mark t
source share