Question: public static void copy ( List l 1 ) { List l 2 = new List < > ( ) ; int n = l

public static void copy(List l1){
List l2= new List<>();
int n = l1.size();
for( int i=0; i < n; i++){
int next = l1.remove(0);
l2.add(next);
}
}
The above method is
Question 7 options:
about the same speed (in expectation) independent of whether l1 and l2 are both ArrayLists or Skiplists
much faster (in expectation) when l1 and l2 are ArrayLists
much faster (in expectation) when l1 and l2 are Skiplists

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!