title: How to obtain the index permutation after the sorting
body: <p>Given an array <code>arr = {5, 16, 4, 7}</code>, we can sort it through <code>sort(arr, arr+sizeof(arr)/sizeof(arr[0]))</code>.
  so now the array <code>arr = {4, 5, 7, 16}</code> and the permutation index for the sorted array is <code>{2, 0, 3, 1}</code>.
  In other words, the <code>arr[2]</code> in the original array is now the smallest element in the sorted array in position <code>0</code>.</p>
  <p>Is there an efficient way so that we can get the permutation index?</p>