My task is to use a recursive boolean method to find out if or if not an array with its indexes I give to the method is sorted in an up-counting way. I solved the non-recursive task but I'm stuck now cuz IDK how to make a recursive method which has to give an array every time... here my idea
public static boolean isSortedRecursive(int[] a) {
int k=a.length-1;
int z=a[k];
int v=a[k-1];
if(z>v){
return false;
}
else if(z<a.length){
k--;
isSortedRecursive(a);
return true;
}
isSortedRecursive(a);
//return false;
}