title: which sorting algorithm to use where?
body: <p>There are varieties of sorting algorithms available. Sorting algorithm with time complexity of O(n^2) may be suited over O(nlogn), because it is in-place or it is stable. For example:</p>
  
  <ul>
  <li>For somewhat sorted things insertion sort is good.</li>
  <li>Applying quick sort on nearly sorted array is foolishness. </li>
  <li>Heap sort is good with O(nlogn) but not stable.</li>
  <li>Merge sort can't be used in embedded systems as in worst case it requires O(n) of space complexity.</li>
  </ul>
  
  <p>I want to know which sorting algorithm is suitable in what conditions.</p>
  
  <ul>
  <li>Which sorting algo is best for sorting names in alphabetical order?</li>
  <li>Which sorting algo is best for sorting less integers?</li>
  <li>Which sorting algo is best for sorting less integers but may be large in range (98767 – 6734784)?</li>
  <li>Which sorting algo is best for sorting billions of integers?</li>
  <li>Which sorting algo is best for sorting in embedded systems or real time systems where space and time both are constraints?</li>
  </ul>
  
  <p>Please suggest these/other situations, books or website for these type of comparisons.</p>