title: Hashtable- Rehashing
body: <p>I have been told that <code>Hashtable</code> in <code>.NET</code> uses rehashing in order to reduce/avoid collision.</p>
  
  <p>Ie. “Rehasing works as follows:  assume we have a set of hash different functions, H1 ... Hn, and when inserting or retrieving an item from the hash table, initially the H1 hash function is used. If this leads to a collision, H2 is tried instead and onwards up to Hn to avoid collision in Hashtable.”</p>
  
  <p>Assumption: We have a hashtable with n (where n &lt; Infinity) element where asymptotic time complexity is o(1); we (CLR) have achieved this  while applying some hashing function ( Hn-1   hash function where n>1).</p>
  
  <p>Question: 
  Can someone explain me how CLR map Key to the hash code when we seek (retrieve) any element (if different hashing functions are used)? How CLR track (if it) the hashing function of any live object (hash table)?</p>
  
  <p>Thanks in advance </p>