Ohk I wasnt sure how you associted the arrays.
Well the method does preserve the association between the arrays but not the way u think. The elemens in the first array is associated with the elements in the second array using the same index.
So the first value of 34 in the first array is associated to value 3 in the second array cuz they both have the index 0.
That way, even after sorting the association is not lost. Your way of associating nth element in the first array to nth element in the second array is not recommended cuz its VERY easy to screw up (eg: if both arrays dunth ave the same number of elements).
Tell me if u get my point.