reverse order in O(n/2)