Question: Which methods described in our basic List interface might result in an exception being thrown? Modify the posted code to throw exceptions where appropriate. Of
Which methods described in our basic List interface might result in an exception being thrown? Modify the posted code to throw exceptions where appropriate. Of each of the methods described in our basic List interface that accept arguments, what arguments and array state result in the worst case possible runtime (there may be a tie)? Imagine a method removeRange(int, int) that takes two indices as arguments. The method removes all the elements starting at the first index and ending at the last index. Implement the removeRange(...) method in code so that your method calls the normal remove(...) method to remove each element in the range - what is the runtime estimate (big O) for this implementation? Then try implementing removeRange(...) without use of the remove(...) method - what is the best runtime you can achieve? Which methods described in our basic List interface might result in an exception being thrown? Modify the posted code to throw exceptions where appropriate. Of each of the methods described in our basic List interface that accept arguments, what arguments and array state result in the worst case possible runtime (there may be a tie)? Imagine a method removeRange(int, int) that takes two indices as arguments. The method removes all the elements starting at the first index and ending at the last index. Implement the removeRange(...) method in code so that your method calls the normal remove(...) method to remove each element in the range - what is the runtime estimate (big O) for this implementation? Then try implementing removeRange(...) without use of the remove(...) method - what is the best runtime you can achieve
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
