Search code examples
javacollectionsscjpocpjp

Java - Choosing the right collection


Possible Duplicate:
Rule of thumb for choosing an implementation of a Java Collection?

I am looking for a 'Summary' list of all the Java collections detailing the pros and cons of each. I am particularly interested in things like

  • Which provide faster iteration
  • Which provide faster search
  • Which provide slower iteration
  • Which provide faster insertion or removal

I have seen some sites by searching on Google but i am looking for just a summary preferable in table format.

Thanks in advance.


Solution

  • Take a look at the Collections tutorial, particularly the section on implementations, which includes (in subsections) a discussion of performance characteristics for the various predefined classes. The collections framework is so large, I think, that it would be difficult to summarize everything in a single table.