title: how c++ vector works
body: <p>Lets say if I have a vector V, which has 10 elements. 
  If I erase the first element (at index 0) using <code>v.erase(v.begin())</code> then how STL vector handle this? </p>
  
  <p>Does it create another new vector and copy elements from the old vector to the new vector and deallocate the old one? Or Does it copy each element starting from index 1 and copy the element to index-1 ? </p>
  
  <p>If I need to have a vector of size 100,000 at once and later I don't use that much space, lets say I only need a vector of size 10 then does it automatically reduce the size? ( I don't think so) </p>
  
  <p>I looked online and there are only APIs and tutorials how to use STL library. 
  Is there any good references that I can have an idea of the implementation or complexity of STL library?</p>