Given the restrictions, you should use a HashMap. This will give you a quick search of your choice.
If you are interested in moving items in a specific order, you should choose TreeMap (natural order) or LinkedHashMap (insert order).
If your collection is guaranteed unchanged, you can use a sorted ArrayList with binary search, it will save you some memory. In this case, you can search for only one specific key, which is undesirable in many real-world applications.
In any case, you must have a really huge number of elements (millions / billions) in order to feel the difference between O (logN) solutions and O (1) solutions.
If you want to learn more about data structures, I recommend that you study the Algorythms course at Princeton University on coursera.com
source share