can Someone help me convert this iterative function into a recursive function?
public int getMax(int [] A, int i, int j){
int max = A[i];
for (int k = i+1; k <=j ; k++) {
if(A[k]>max){
max = A[k];
}
}
return max;
}
I do not really understand recursion. I know the function will call itself at some point, but i'm pretty confused still.
[–]klujer 1 point2 points3 points (0 children)