Suppose we have three arrays a
, b
and c
:
int a[1000] = {3,1,5,4}; int b[1000] = {7,9,11,3}; char c[1000] = {'A','B','C','D'};
Array a
then sorted, so it becomes:
a == {1,3,4,5}
Is it possible to arrange the other two arrays so that their elements are rearranged by index so that they display the location of the sorted elements in the sorted array a
? In this example, this should result in
b == {9,7,3,11} c == {'B','A','D','C'}
How can i achieve this?
source share