public static int[] organizaC(int[] v) {
int i, temp = 0;
if (v.length > 0) {
for (i = 0; i < v.length; i++) {
if (v[i] > v[i + 1]) {
temp = v[i];
v[i] = v[i + 1];
v[i + 1] = temp;
i = 0;
}
}
return v;
} else {
return null;
}
}
I'm getting an ArrayOutofBoundsIndex
exception when trying to use this function but the IDE won't let me use the debugger. Anyone knows what is happening? Am I causing some buggy loop?