which data structure?

Hi there...

Could you let me know what is the most efficient data structure to use (in terms of storage and access) if I have to store around 1 million <key,value> pairs?

Thanx :)

Tariq

[213 byte] By [TJayseea] at [2007-11-27 11:11:31]
# 1

My first thought: HashMap or Hashtable ?

What does this question have to do with concurrency?

DikkeDouwea at 2007-7-29 13:48:46 > top of Java-index,Core,Core APIs...
# 2

eh? what was that? concurrency?

TJayseea at 2007-7-29 13:48:46 > top of Java-index,Core,Core APIs...
# 3

Yes, concurrency, when two or more threads would act upon the same data or data structure. Concurrent access, etc. Your question has nothing to do with concurrency, but rather Collections. But yes, HashMap or Hashtable depending on if one thread is going to be accessing the same data or multiple threads. Also a database might come in handy as well, such as MySQL or JavaDB (Apache Derby).

kmangolda at 2007-7-29 13:48:46 > top of Java-index,Core,Core APIs...