Top Posters
Since Sunday
g
3
3
2
J
2
p
2
m
2
h
2
s
2
r
2
d
2
l
2
a
2
New Topic  
trea48 trea48
wrote...
Posts: 450
Rep: 0 0
3 years ago
Suppose list1 is an MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code:

A:
for (int i = 0; i < 100000; i++)
list1.add(i);

B:
for (int i = 0; i < 100000; i++)
list2.add(i);


▸ Code fragment B runs faster than code fragment A.

▸ Code fragment A runs faster than code fragment B.

▸ Code fragment A runs as fast as code fragment B.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


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

Related Topics

trea48 Author
wrote...

3 years ago
Correct Slight Smile TY
wrote...

Yesterday
This helped my grade so much Perfect
wrote...

2 hours ago
Good timing, thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1102 People Browsing
 119 Signed Up Today
Related Images
  
 276
  
 80
  
 329
Your Opinion
What's your favorite math subject?
Votes: 293