What values should I pass to create an efficient HashMap / HashMap based structures for N items?
HashMap
In an ArrayList, the efficien
ArrayList
In the guava libraries from Google there is a function that creates a HashMap optimized for a expected number of items: newHashMapWithExpectedSize
from the docs:
Creates a HashMap instance, with a high enough "initial capacity" that it should hold expectedSize elements without growth ...