Sort this array in a way reserving the relative position -- Google