title: Most efficient method to sort on the fly
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5831558/how-to-sort-data-at-the-time-of-adding-it-not-later">how to sort data at the time of adding it, not later?</a>  </p>
  </blockquote>
  
  
  
  <p>I need to sort data on the fly. Basically I have an array in which elements will be inserted. After each insert, the data should be sorted. What is fastest way to achieve that?</p>