This topic contains a solution. Click here to go to the answer

Author Question: Suppose list1 is a MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. ... (Read 63 times)

maegan_martin

  • Hero Member
  • *****
  • Posts: 532
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.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by maegan_martin on May 6, 2020

Jayson

  • Sr. Member
  • ****
  • Posts: 350
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 50% of students answer this correctly




maegan_martin

  • Member
  • Posts: 532
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


flexer1n1

  • Member
  • Posts: 373
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Persons who overdose with cardiac glycosides have a better chance of overall survival if they can survive the first 24 hours after the overdose.

Did you know?

Human stomach acid is strong enough to dissolve small pieces of metal such as razor blades or staples.

Did you know?

Your heart beats over 36 million times a year.

Did you know?

The top five reasons that children stay home from school are as follows: colds, stomach flu (gastroenteritis), ear infection (otitis media), pink eye (conjunctivitis), and sore throat.

Did you know?

It is widely believed that giving a daily oral dose of aspirin to heart attack patients improves their chances of survival because the aspirin blocks the formation of new blood clots.

For a complete list of videos, visit our video library