Biology Forums - Study Force

Science-Related Homework Help Computer Studies Topic started by: wrightjb on May 5, 2020



Title: Suppose list1 is a MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. ...
Post by: wrightjb on May 5, 2020
Suppose list1 is a MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code:

A:
for (int i = 0; i < list1.size(); i++)
sum += list1.get(i);

B:
for (int i = 0; i < list2.size(); i++)
sum += list2.get(i);


▸ Code fragment A is as efficient as code fragment B.

▸ Code fragment B is more efficient that code fragment A.

▸ Code fragment A is more efficient that code fragment B.


Title: Suppose list1 is a MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. ...
Post by: Isack on May 5, 2020
Content hidden