Re: Java questions: Urgent



On 30 Jan 2006 20:08:31 -0800, "Nikil Joshi" <kiranpannu@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :

>1, how fast is hash map? explain in terms of time complexity?

It depends on how relatively full it is. If you keep it less that 3/4
full your chains will be short and it wont' take any more time to look
up in a big list as a small. But if you let it approach 100% full,
then chains can get very long. In the most pathological case when all
your hashes are equal the lookup time is proportional to N, the size
of the list since all item are one one chain.

See http://mindprod.com/jgloss/hashcode.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.