Question: Thank you very much! Practice: ArrayList(JAVA) Problem 1 Implement the methods described by the JavaDoc comments: public class ArrayList implements List211 { /** Holds the
Thank you very much!
Practice: ArrayList(JAVA)
Problem 1
- Implement the methods described by the JavaDoc comments:
public class ArrayListimplements List211 { /** Holds the items in the list. */ private E[] data; /** The size of the list. */ private int size; /** * Constructs an empty list with an initial capacity of ten. */ public ArrayList() { // your steps / code goes here } /** * Removes the element at the specified position in this list. Shifts any subsequent elements to the * left (subtracts one from their indices). * @param index the index of the element to be removed * @return the element that was removed from the list. * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size()) */ public E remove(int index) { // your steps / code goes here. } }
Problem 2
-
Answer the following questions:
-
When do you need to resize data?
-
Why do we keep track of size?
-
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
