How does merge sort perform in terms of time complexity compared to other sorting algorithms for large datasets?

  • O(log n)
  • O(n log n)
  • O(n)
  • O(n^2)
Merge sort excels in time complexity for large datasets, performing at O(n log n), which is more efficient than O(n^2) algorithms like bubble sort or insertion sort. This makes merge sort a preferred choice for large-scale sorting tasks.
Add your answer
Loading...

Leave a comment

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