And thus spoke gaurav v bagga...

> I have key,value pair of structure and I want to store them in a

> collection. Which collection will be good with respect to retrieval

> speed.
....

> I found out from net that HashMap is better then TreeMap in retrieval

> speed.
NEVER EVER decide something like this based by throwing 14 values at it

and look how much "Date" it takes... Sorry, but it doesn't say much. I

wouldn't even trust such an experiment if you threw thousands of random

numbers at it

A better way to do it...

1. Read the JavaDoc of HashMap and TreeMap. There you'll find which

algorithms are used by these classes. In some cases you'll find the

complexity of these algorithms there.

2. Use the web or a good book to find out, which Algorithem has which

complexity for which method, if you didn't find it in the JavaDoc.

THEN you can decide, which algorithm to use. If you do not understand an

algorithm, you will never be able to decide if it's the best one for

your job. If you don't know what "Complexity" or "O(n log n)" means, I

would advise you to read _at least_ what wikipedia has to offer about

these topics. You don't have to know how to prove a complexity, but you

should understand, what it means

Flo