title: How to implement a dynamic-size hash table?
body: <p>I know the basic principle of the hash table data structure. If I have a hash table of size N, I have to distribute my data into these N buckets as evenly as possible.</p>
  
  <p>But in reality, most languages have their built-in hash table types. When I use them, I don't need to know the size of hash table beforehand. I just put anything I want into it. For example, in <code>Ruby</code>:</p>
  
  <pre class="lang-rb prettyprint-override"><code>h = {}
  10000000.times{ |i| h[i]=rand(10000) }
  </code></pre>
  
  <p>How can it do this?</p>