We won't re-invent the mechanism for working with hashes — It has already been implemented in lots of collections.
We'll grab HashMap and use it.
1. Create a private Object PRESENT constant and initialize it with an Object. This will be our stub.
2. Create a private transient HashMap m
AmigoSet (part 2)
- 30
Locked
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Coboliste
6 February, 21:17
Hello everyOne,
Does anyone please know why we have to use the following formula to calculate the initial capacity of the map according to the requirements ?
int capacity = Math.max(16, (int)Math.ceil(collection.size()/.75f));
Thanks for the answer.
0