I have two arrays in same size. And want to sort one of the array normally and then sort the next array elements accordingly. Let's say we have two arrays
e[] = {4,2,3,7,6,8}
s[] = {2,0,4,3,7,9}
First I want to sort array e
normally, Then change the element positions of s
array according to the changed element positions of e
.
This should be the final result
e[] = {2,3,4,6,7,8}
s[] = {0,4,2,7,3,9}
How should I do this? Should I use a class object with these two as private members and then proceed? If so, how to do that?