Java Array of Linked Lists
<p>I am trying to code a custom hashtable which can allows multiple values.</p>

<p>We are doing it in following way:</p>

<ol>
<li>Create an array of Linked Lists of the size Integer_MAX (custom linked list).</li>
<li>Insert values (int's) to the Linked Lists whose number is key number.</li>
</ol>

<p>Means structure like:</p>

<pre><code>value1 -&gt; value6
NULL
Null
value3 -&gt; value7
Null
...
...(until Int-Max)
</code></pre>

<p>Now, as we will store nearly 500 millions of key value pairs, at-lest 1600 millions link lists are going to be wasted.</p>

<p>Now, as per suggestion fro my working place, I am trying to build hashtable with structure like:</p>

<pre><code>1 -&gt; value1 -&gt; value6
0
0
1 -&gt; value3 -&gt; value7  // here 0/1 bit defines linked lists exits or not
0
...
...(until Int-Max)
</code></pre>

<p>Can anybody help me is this possible to build such kind of structure ?</p>

<p>Edit: </p>

<ol>
<li><a href="http://stackoverflow.com/questions/11765517/java-custom-hash-map-table-some-points">Why we are trying to do this can be found here.</a></li>
<li>Current code (by <a href="http://stackoverflow.com/users/869736/louis-wasserman">Louis Wasserman</a>) can be <a href="https://gist.github.com/3230417" rel="nofollow">found here</a>.</li>
</ol>
