R
RolandFuchs
Gast
Abend, hab ein kleines Problem.
Wirft bei mir eine ArrayIndexOutOfBoundsExeception
was habe ich nicht beachtet?
Java:
static int[] invert(int[] p) {
int l = p.length;
int[] pInv = new int[l];
for (int i = 0; i <= l; i++) {
pInv[p[i]] = i;
}
//DEBUG
for (int i = 0; i < pInv.length; i++)
System.out.print(pInv[i] + " ");
return pInv;
}
Wirft bei mir eine ArrayIndexOutOfBoundsExeception
was habe ich nicht beachtet?