Reference no: EM13766721
1. What is the difference between the size and the capacity of an ArrayLi st? Why might we have a constructor that lets us set the initial capacity?
2. What is the difference between the remove (object obj) and remove (i nt index) methods?
3. When we insert an item into an Ar rayli st, why do we start shifting at the last element?
4. The Vector and ArrayLi st both provide the same methods, since they both imple-ment the Li st interface. The Vector has some additional methods with the same func¬tionality but different names. For example, the Vector addEl errent and add methods have the same functionality. There are some methods that are unique to Vector. Look at the Java API documentation and make a list of the methods that are in Vector that have equivalent methods in ArrayLi st and ones that are unique. Can the unique methods be implemented using the methods available in ArrayLi st?
5. If a loop processes n items and n changes from 1024 to 2048, how does that affect the running time of a loop that is 0(n2)? How about a loop that is O(log n)? How about a loop that is Qn log n)?
6. What is the advantage of a double-linked list over a single-linked list? What is the disadvantage?
7. Why is it more efficient to use an itcrator to traverse a linked list?
8. What is the difference between the Ito rator and Li stiterator interfaces?