Question: Complete the following method from an array-based indexed list with instance variables T[] list and int rear. Assume no previously implemented utility methods. public T

Complete the following method from an array-based indexed list with instance variables T[] list and int rear. Assume no previously implemented utility methods. public T remove(int index) { //check index if (index = rear) { throw new IndexOutOfBoundsException: } // store element being removed T retVal = list[index]; //shift elements INSERT YOUR CODE HERE //update rear rear- //return removed element return retVal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
