Suppose that each array at right were passed as a parameter to
the mystery method below. Fill in the boxes with the array
contents after each method call.
public static void mystery(int[] a) {
for (int i = 0; i < a.length - 1; i++) {
if (a[i] < a[i + 1]) {
a[i] = a[i + 1];
}
}
}
|
|