I have two arrays:
names(1 to 20) ---- a string array
values(1 to 20) ----- a numerical array (double)
Both arrays are linked, i.e. i-th element of names corresponds to i-th element of values.
I need to sort both arrays on values, i.e. after sorting the 2nd array (values) will have all decrementing values and its i-th element will correspond to the same name as before sorting (i-th element of names)
Please suggest the most elegant way of doing that.