Top Posters
Since Sunday
25
12
10
9
l
4
4
w
3
M
3
3
C
2
2
s
2
New Topic  
lizsmith lizsmith
wrote...
Posts: 440
A year ago
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.
Textbook 

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 27 times
2 Replies
Replies
Answer verified by a subject expert
vvnluuvvnluu
wrote...
Posts: 383
A year ago
Sign in or Sign up in seconds to unlock everything for free
More questions for this book are available here
Code fragment B runs faster than code fragment A.

Related Topics

wrote...
A month ago
Thank you so much
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  100 People Browsing
 726 Signed Up Today
Your Opinion
Who's your favorite biologist?
Votes: 134

Previous poll results: How often do you eat-out per week?
Related Images
 632
 146
 127