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) {
}
Precondition: x.length > 0
The fact that I can't have the function return anything, and the only argument is an array is leaving me stumped.
I've tried using loops along with the recursion, but everything I've tried seems to end up with infinite instances of the function being made.
I've gotten an idea/suggestion to use another function along with this one, but, how to use the original recursively is beyond me at the moment.
Any help is appreciated.
Try something as below: