I have an array of 36 numbers, which I need sorted. The only problem is, the index is related to its value; i.e. the 16th element's value is useless unless I know that its the *16th's* element's value. If I did a traditional sort, the values and their indices would become all jumbled up.
What I've figured out so far is that the sorted array will be two-dimensional (at least I think). So, if in the original array, the 16th indice had the highest value, the first indice (0,0)of the new two dimensional array would be 16, and the index of (0,1) would have the value of whatever it was in the original array.
It makes sense if you think about it...
Any Ideas?
What I've figured out so far is that the sorted array will be two-dimensional (at least I think). So, if in the original array, the 16th indice had the highest value, the first indice (0,0)of the new two dimensional array would be 16, and the index of (0,1) would have the value of whatever it was in the original array.
It makes sense if you think about it...
Any Ideas?