0

I have been solving the following problem :
Input array : {7,4,2,5,1,9,6}
Output array : {1,4,6,9,7,5,2}
I tried to do it in the following way:
Sort the array. So, Input array becomes {1,2,4,5,6,7,9} run time O(nlgn)
Numbers in even indices are 1,2,6,9 an in odd indices are 2,5,7. Move all ...