Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

25
  • 6
    Actually, there are implementation of QuickSort which are O(n*log(n)), not O(n^2) in the worst case. Commented Sep 16, 2008 at 22:17
  • 15
    It also depends on the computer architecture. Quicksort benefits from the cache, while MergeSort doesn't. Commented Sep 28, 2008 at 1:53
  • 5
    @J.F. Sebastian: These are most probably introsort implementations, not quicksort (introsort starts as quicksort and switches to heapsort if it is about to stop being n*log(n)). Commented Oct 19, 2008 at 21:50
  • 51
    You can implement a mergesort in place. Commented Oct 20, 2008 at 9:25
  • 8
    Merge sort may be implemented in a way that only requires O(1) extra storage, but most of those implementations suffer greatly in terms of performance. Commented Dec 21, 2014 at 19:07