title: Which sorting algorithm works best on very large data set that won't fit in the main memory
body: <p>I was searching on the Internet to find which sorting algorithm is best suitable for a very large data set. I found that many have an opinion that merge sort is best because it is fair, as well as that it ensures that time complexity is O(n log n) and quick sort is not safe: It is also true that variations of quicksort can also be not safe because the real data set can be anything.</p>
  <p>If swapping of the two elements has negligible time cost, then why can't we choose heap sort as the best sorting algorithm in this case because it is in place as well as O(n log n)?</p>
  <p>In case of Merge sort it requires another O(n) space; if the data is very large then we can't use this algorithm.</p>
  <p>Which algorithm should be the best in this scenario?</p>