I am trying to code a custom hashtable which can allows multiple values.
We are doing it in following way:
- Create an array of Linked Lists of the size Integer_MAX (custom linked list).
- Insert values (int's) to the Linked Lists whose number is key number.
Means structure like:
value1 -> value6
NULL
Null
value3 -> value7
Null
...
...(until Int-Max)
Now, as we will store nearly 500 millions of key value pairs, at-lest 1600 millions link lists are going to be wasted.
Now, as per suggestion fro my working place, I am trying to build hashtable with structure like:
1 -> value1 -> value6
0
0
1 -> value3 -> value7 // here 0/1 bit defines linked lists exits or not
0
...
...(until Int-Max)
Can anybody help me is this possible to build such kind of structure ?
Edit:
- Why we are trying to do this can be found here.
- Current code (by Louis Wasserman) can be found here.