title: Improvement over vector assignment and clear
body: <p>Many time I deal with this type of code:</p>
  
  <pre><code>vector&lt;int&gt;prev,cur;
  
  for(i=1;i&lt;n;i++){       
  
      //do some operation on cur based on prev vector
  
      prev = cur;
  
      cur.clear();
  }
  </code></pre>
  
  <p>Is there any scope of time complexity improvement? As time complexity of clear is linear in terms of its element (container destructor is called), is there any way to do this operation on O(1) or less time by any other method? Should I use pointer to vectors then change pointer for doing </p>
  
  <blockquote>
    <p>prev  =  cur</p>
  </blockquote>