Question: Suppose list 1 is a MyArraylist and list 2 is a MyLinkedList. Both contains 1 milton double values. Analyre the following code: for ( int

Suppose list 1 is a MyArraylist and list2 is a MyLinkedList. Both contains 1 milton double values. Analyre the following code:
for (int 1=0;11 ist1.size(); i++ sum t= list1,get(i);
sum to list1.get(i);
B:
for (int i=0;i list2.sizeo); i++ sum += list2.get(i);
sum += list2.get (i);
Code fragment B is more efficient that code fragment A.
Code fragment A is as efficient as code fragment B.
Code fragment A is more efficient that code fragment B.
 Suppose list 1 is a MyArraylist and list2 is a MyLinkedList.

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 Databases Questions!