When is it preferable to use merge sort over quicksort?

  • Input size
  • Memory usage
  • Stability of sorting
  • Time complexity
Merge sort is preferable over quicksort when dealing with large input sizes due to its guaranteed O(n log n) time complexity, which is advantageous over quicksort's worst-case O(n^2) time complexity.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *