Data Structure Brushup (Java)

Posted by Daddy Warbox on Stack Overflow See other posts from Stack Overflow or by Daddy Warbox
Published on 2008-12-03T14:54:37Z Indexed on 2010/06/01 13:23 UTC
Read the original article Hit count: 125

Filed under:
|

This should be easy for many of you, but for me it's just another bit of rust needing to be chipped away as I get back into basic Java coding. Using bloody associative arrays for so long in other languages have turned me nice and spoiled. :P

My problem is simple: I'm storing a set of objects, each containing a string and a number, in a list. I would like each object inserted into this list to be sorted alphabetically by its string. I would also like to be able to retrieve objects from the list by their string as well. I would like to do this as formally and/or efficiently as possible.

Is there something already available in the Java standard libraries for this?

© Stack Overflow or respective owner

Related posts about java

Related posts about data-structures