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) {
Since there's been no statement that loops cannot be used:
void reverseArray(int[] x) { if (x != null) { for (int i = 0; i < length.x / 2; i++) { int j = (length.x - 1) - i; int temp = x[i]; x[i] = x[j]; x[j] = temp; } reverseArray(null); } }
Probably the fastest of the lot.