File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
LinkedXXX vs XXX iteration speed
Joined: Jul 29, 2009
Feb 02, 2010 10:26:25
K&B 6 book ch 7:
p. 562: "...LinkedList may iterate more slowly then an ArrayList"
p. 564: "...you can expect faster iteration with a LinkedHashMap" (compared to HashMap)
So do LinkedXXX provide slower or faster iteration compared to XXX? I'd expect the trend be the same for Lists and Maps?
Joined: Aug 03, 2008
Feb 02, 2010 23:38:07
I'd expect the trend be the same for Lists and Maps?
Why?? Lists and Maps are two completely different things. Iteration speed depends on the implementation of a collection. It doesn't has to do anything with names (LinkedXXX or XXX)...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
I agree. Here's the link:
subject: LinkedXXX vs XXX iteration speed
LinkedList - Kathy Sierra
Mock Exam Question
Collections : Help Needed
K&B Java 5 scjp ch7 page 24/114
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014