Question: There are methods of AbstractList that have working implementations that are less efficient than they could be if direct access to the instance fields. What
There are methods of AbstractList that have working implementations that are less efficient than they could be if direct access to the instance fields. What method(s) of AbstractCollection and AbstractList should be overridden in ArrayList in order to improve efficiency (i.e., what method(s) could execute faster if a different algorithm had direct access to the instance fields)? Think about all the "slow" algorithms in AbstractList applied to array-based collections and think creatively about how they could be made faster by doing fewer "shifts." Justify your answer with a high-level algorithmic explanation.
Provided code to fill below:
1. Method: _____ Current Big-O: ____ New algorithm (describe) : ____ New Big-O: ____ Repeat as many of the above as needed.
Examples of overriding methods could be: equals, removeAll, addAll, retainAll, clear
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
