I want to create my custom Hash Table for key with multiple values. For that, what I want to do is following:
1) Create an array of Linked Lists/ Array-list of the size Integer_MAX.
2) Insert values (int's) to the Linked Lists/ Array-list whose number is key number.
Now, I am facing two issues:
1) How to define array of Linked Lists/ Array-list's.
2) Is there any way to make them primitive ?
Any help or any idea to make it better will be helpful to me.
Thanks.
Edit: I know that Hash Table concept has nothing to do with key with multiple values. But, I want to make it like that.
I want to make a custom hash map and for primitives (not for objects as it takes really huge space like guava).
I would highly recommend using a Multimap from the guava project. You can use an ArrayListMultiMap and get exactly the behavior you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With