Biology Forums - Study Force

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



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

A:
while (list1.size() > 0)
list1.remove(0);

B:
while (list2.size() > 0)
list2.remove(0);


▸ Code fragment B runs faster than code fragment A.

▸ Code fragment A runs as fast as code fragment B.

▸ Code fragment A runs faster than code fragment B.


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