i want to know efficient sorting method in nx2 array in c++ : For example, if an array is stored like this  

ex) input

0 1 2 3 4 5 6 7 8 9
7 5 3 9 1 2 4 8 6 0

i want to print the idx of the second array in order of magnitude

ex) output

3 , 7 , 0 , 8 , 1 , 6 , 2 , 5 , 4 , 9 

What is an efficient way to do this?