title: Simple hash table with vector
body: <p>As i understood correctly , implementing hash table , is calculating index based on inputed string , and returning it directly making it simple key - value storage.</p>
  
  <p>So simple hash function could look something like</p>
  
  <pre><code>int hash( string name ){
  
      int index = 0;
      int hash = 0;
      for ( int i = 0; i &lt; name.length() ;i++){
          hash += (int)name[i];
      }
      index = sizeOfArray % hash;
  }
  </code></pre>
  
  <p>SizeOfArray is array of pointers with predefined size. If this index does not exists it creates it. But how i implement it with vectors?</p>
  
  <p>Vector does not have predefined size. An they grow automaticly. So calling sizeOfArray % hash will change everytim vector will grow.</p>
  
  <p>What is logic behind has tables? Whats the best method to calculate index even with growing vector / array?</p>