Top Posters
Since Sunday
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
4
r
4
New Topic  
wrightjb wrightjb
wrote...
Posts: 419
3 years ago
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.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 40 times
1 Reply
Replies
Answer verified by a subject expert
IsackIsack
wrote...
Posts: 394
3 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

wrightjb Author
wrote...

3 years ago
This calls for a celebration Person Raising Both Hands in Celebration
wrote...

Yesterday
Good timing, thanks!
wrote...

2 hours ago
This site is awesome
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1335 People Browsing
 110 Signed Up Today
Related Images
  
 79
  
 289
  
 296
Your Opinion
Which country would you like to visit for its food?
Votes: 204