title: Is it faster to sort an array or use a heap while inserting
body: <p>I have a constant stream of numbers that I am generating that I will later need to iterate over. </p>
  
  <p>Is it more efficient to add them to an array then use <code>std::sort()</code> or to add them to a <code>heap</code>(priority queue) and then later pop them off?</p>
  
  <p>Currently, I just have a <code>vector</code> that I am pushing back. Would another data structure better suited for sorting-as-i-go-along? So the question is would be inserting into a heap n times at <code>log(n)</code> per insert (<code>nlogn</code>) be faster than just sorting after the fact (also <code>nlogn</code>)?</p>