Java Collection:Collection framework:Less bucket is good to store object in collection or large number of bucket? [closed]

StackOverflow https://stackoverflow.com/questions/21474608

Here i just want to ask one question which i faced in Java interview. Question was like how hashmap works.I explained and answered all following questions.But i stuck at one question,which was: Is it better to have more bucket of objects in collection or less bucket?and why? Please help me here with your view

有帮助吗?

解决方案

Best HashMap = Unique Ids - one bucket for one object - fastest access to object when you know the key.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top