I have a gigantic data set which I've to store into a collection and need to find whethere any duplicates in there or not.
The data size could be more than 1 million. I know I can store more element in ArrayList comapre to a Map.
My questions are:
- is searching key in a
Mapfaster than searching in sortedArrayList? - is searching Key in
HashMapis faster thanTreeMap? - Only in terms of space required to store
nelements, which would be more efficient between aTreeMapand aHashMapimplementation?