Question: Java 1. public static void ther ArrayList integer> values) i This function should update in-place the values arrayist so that after returning, the values arraylist
Java


1. public static void ther ArrayList integer> values) i "This function should update in-place the values arrayist so that after returning, the values arraylist only contains every other value contained when the function was called. In other words, before returning, the items originally at positions 1, 3 5, 7 should no longer exist in the values arawst and the arraylist should be the size," "Test input: an empty Arraxlist, an Acravist with 5 values, and ArevList with 6 value. If you make the values in the arrauist consecutive, it'l be very easy to see whether you are right; for example: 6, 7, 8, 9, 10. 2. public static void removeEyervOther values) /* This function should update in-place the values array so that after returning. the values array only contains every other value contained when the function was called. In other words, before returning, the items originally at positions 1, 3, 5, 7 should no longer exist in the values array and the array should be the size. .. Test input same as #1 3. public static ArrayList integer? getEvervOtberlArrayListclnteger? values) /* This function should return a new ralist that contains every other value contained in the values arraylist. In other words, the function should return a new arravlist containing the values from positions 0, 2, 4, 6.. and input atraylist values should remain unchanged. I .. Test input same as #1 4.public static intl getEverOtber(int[l values) /* This function should return a new array that contains every other value contained in the values array. In other words, the function should return a new array containing the values from positions 0, 2, 4, 6.... and input array values should remain unchanged. "I .. Test input same as #1 5. public static HashMapeString, String> bildLastNameToFirstNameMap(String] fullNames) fulNamis an array of entries all in the format "FirstNam Lastame", a first name and a last name separated by a space. This function should return a map where the keys are the LastNam from the input array and the corresponding value is the associated FirstName, You may assume each LastName only occurs once in the input array. "I "Test input: an empty array; an array containing "Barry White"and "Bob Marley
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
