I haven\'t found anything with the specific needs of my function to do this, yes, it is for homework.
So I have:
public void reverseArray(int[] x) {
void reverseArray(int[] x){ reverse(x, 0, x.length -1); } void reverse(int[] x, int i, int j){ if(i
Test:
int[] s = new int[]{1,2,3,4,5}; reverseArray(s); System.out.println(Arrays.toString(s));//"5,4,3,2,1"
Recursive, O(n), no temporary Array needed.