I am trying to keep track of a sorted array in c#. What I mean by this is if I have two arrays: Array 1 and Array2, and they are in a specific order so that they link together, if I sort Array 1 into ascending order and the order looks like (I am trying to keep track of the order, not the contents really):
ARRAY1 ARRAY2 sortedARRAY1
0 0 4
1 1 1
2 2 0
3 3 2
4 4 3
Is it possible to keep track of the order and arrange 'ARRAY2' in accordance to the sortedARRAY1? So it would look something like this:
ARRAY1 ARRAY2 sortedARRAY1 SortedARRAY2
0 0 4 4
1 1 1 1
2 2 0 0
3 3 2 2
4 4 3 3