Answer the question
In order to leave comments, you need to log in
How is data stored in a hash table?
We take the Java Object::hashCode as a hash function. Then (ignoring collision) we will have a maximum of Integer.MAX_VALUE (2,147,483,647) unique objects. And it turns out that we need to allocate an array of this size to store objects. But such an array, even an empty one, would take up a lot of memory. How is this problem solved?
Answer the question
In order to leave comments, you need to log in
2,147,483,647
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question