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