I have two arrays, x and y, where y is the value of the tens of every element in x. Now, I want to sort y. But, the order of y will be different of x‘s. So, I can’t tell after sorting which element in y was related to, for instance, x[0].
I want a “double sorting” maybe.
Array.Sorthas an overload that accepts two arrays; one for the keys, and one for the items. The items of both are sorted according to thekeysarray:So in your case, it sounds like you want: