News

At this point, the middle element arr[2] = 3 is already in its correct place, and the array is fully reversed.; Reason for arr.length / 2:. The array has arr.length elements.; To reverse the array, ...