Consider the following method:
public static void arrayMystery(int[] a) { for (int i = 1; i < a.length - 1; i++) { a[i] = a[i - 1] - a[i] + a[i + 1]; } }
In the left-hand column below are specific lists of integers. Indicate in the right-hand column what values would be stored in the list after method mystery executes if the integer list in the left-hand column is passed to it as a parameter.
{42, 42}
|
{42, 42} |
|
{6, 2, 4}
|
{6, 8, 4} |
|
{7, 7, 3, 8, 2}
|
{7, 3, 8, 2, 2} |
|
{4, 2, 3, 1, 2, 5}
|
{4, 5, 3, 4, 7, 5} |
|
{6, 0, -1, 3, 5, 0, -3}
|
{6, 5, 9, 11, 6, 3, -3} |