title: Hashing algorithm and HashMap
body: <p>There are several topics on this in stackoverflow as well as in web, I could not understand them clearly. I found this answer in stackoverflow by Nicklas and his representation which gave me some meaningful insight over the topic. </p>
  
  <h3>Some ASCII art</h3>
  
  <pre><code>key.hashCode()
       |
       | 32-bit value
       |                          hash table
       V                        +------------+    +----------------------+
  HashMap.hash() ----+          | reference  | -&gt; | key1 | value1 | null |
                     |          |------------|    +----------------------+
                     |          | null       |
                     | offset   |------------|    +---------------------+
                     +--------&gt; | reference  | -&gt; | key1 | value1 | ref |
                                |------------|    +---------------------+
                                |    ....    |                       |
                                                    +----------------+
                                                    V
                                                  +----------------------+
                                                  | key2 | value2 | null |
                                                  +----------------------+
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/9364134/what-hashing-function-does-java-use-to-implement-hashtable-class">What hashing function does Java use to implement Hashtable class?</a></p>
  
  <pre><code>Map aMap = new HashMap();
  aMap.put(key,value);
  </code></pre>
  
  <ol>
  <li>Can anyone explain me `what is an offset and its value?. Where is
  the offset value getting mapped?.</li>
  <li>what's that hash-table?. Is it an Array of Objects?, If so does each
  object have an key, value1 and a reference propery?.</li>
  </ol>
  
  <p><strong>Can anyone re-explain the above diagram step-by-step.</strong> I am not able to understand the Hashing mechanism behind HashMap.</p>