Write the Java procedure reverseArray: /* reverseArray ( int[] ) procedure rever
ID: 3764574 • Letter: W
Question
Write the Java procedure reverseArray:
/*
reverseArray ( int[] )
procedure reverses the order of the given integer array
ex1: when reverseArray( {1, 2, 3, 4, 5} ) returns,
the array argument is {5, 4, 3, 2, 1}
ex2: when reverseArray( {} ) returns, the array argument is unchanged
ex3: when reverseArray( {1} ) returns, the array argument is unchanged
*/
Hint: Swap pairs of integers, beginning at the ends of the array and working toward the center. If the array contains an odd number of integers, the middle integer does not move.