You can find common data structures under package java.util and its sub-packages.
All of these classes compose the Java Collections Framework
ArrayList vs. Vector
ArrayListis non-thread-safeVectoris thread-safe- You can also get a thread-safe version of
ArrayListviaCollections.synchronizedList(List)
Bag or multiset
- according to
Collection's doc in JDK:Bags or multisets (unordered collections that may contain duplicate elements) should implement this interface directly. - 【todo】What's a
bag? - implementation references:
Bag.javafrom Algorithms, 4th EditionBag.javafrom apache common-collections, all bag implementations reside in packageorg.apache.commons.collection4.bag
【todo】
ArrayDeque- an application - as queue storing request calls in okhttp -
okhttp3.Dispatcher
- an application - as queue storing request calls in okhttp -
data structures dedicated for android
ArrayMap/SimpleArrayMap/ArraySetLruCacheSparseArray/LongSparseArray/SparseXXXArrayPair