CTCI 11.1 sort two half of array using no extra space