Question: Java Question: * deDupAndReverse returns a new array containing the unique values in the * original array reversed. There should not be any extra space
Java Question:

* deDupAndReverse returns a new array containing the unique values in the * original array reversed. There should not be any extra space in the array there should * be exactly one space for each unique element CHint: numUnique tells you * how big the array should be). You may assume that the list is sorted, as you did for numUnique * Your solution may call numUnique, but should not call any other * functions. After the call to numUnique, you must go through the array " exactly one more time. Here are some examples Cusinginformally): * Precondition: the array may be empty, but if it is not empty the array is sorted from low to high your solution can assume this is true *
*new int] 1 11deDupAndReverse(new intlO 11 * new int { 88, 77, 66, 55, 44, 33, 22, 11 }--deDupAndReverse(new int[] { 11, 22, 33, 44, 44, 44, 44, 44, 55, 55, 66, 77, 88 }) new int[] { } --deDupAndReverse(new int[] { }) new int[] { 11 }--deDupAndReverse(new int[] { 11, 11, 11, 11 }) new int { 88, 77, 66, 55, 44, 33, 22, 11 } --deDupAndReverse(new int[] { 11, 11, 11, 11, 22, 33, 44, 44, 44, 44, 44, 55, 55, 66, 77, 88, 88 }) * public static int[] deDupAndReverse (int[] list) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
