I have two arrays. 1 array is an array of distances from a certain point. I know that if I want to sort this by shortest to farthest distance, that is easily done with an array sort. However, my other array is an array of city names that correspond with the distances in the first array. How could I sort the city array such that it would be identical to the distance array order after a numerical sort? Would it be easier to put them both into one array and some how specify to sort only the distance set? I wouldn't know how to do that. Thanks!
2007-05-20
07:35:23
·
3 answers
·
asked by
johndoi
2
in
Computers & Internet
➔ Programming & Design
I should have been a little more clear. I was trying to use the array.sort() function rather than writing a sort from scratch
2007-05-20
08:33:41 ·
update #1