Consider writing a program that produces statistics for long lists of numerical data. Which of the following is the best reason to implement each list with an array, rather than an ArrayList of Integer (or Double) objects?
A. Removal of elements from a list is easier to code for an array than for an ArrayList.
B. Insertion of new elements into a list is easier to code for an array than for an ArrayList.
C. An array of primitive data is more efficient to manipulate than an ArrayList of wrapper objects that contain numbers.
D. Accessing individual elements in the middle of a list is easier for an array than for an ArrayList.
Answer:D
Consider writing a program that produces statistics for long lists of numerical data. Which of the following is the best reason to implement each list with an array, rather than an ArrayList of Integer (or Double) objects?
A. Removal of elements from a list is easier to code for an array than for an ArrayList. B. Insertion of new elements into a list is easier to code for an array than for an ArrayList. C. An array of primitive data is more efficient to manipulate than an ArrayList of wrapper objects that contain numbers. D. Accessing individual elements in the middle of a list is easier for an array than for an ArrayList.