Mergesort

Merge sort is an O(n log n) worst-case comparison-based stable sorting algorithm.

Quicksort

Quicksort is a sorting algorithm invented by C

Algorithm comparisons specific

Quality Example
Better

"I ve looked at the question at why is quicksort better than mergesort"

from question "Quicksort vs Mergesort in terms of comparisons"

"Is quicksort always better than mergesort"

from question "Why is quicksort better than mergesort?"

"Previously discussed on so why is quicksort better than mergesort"

from question "Quicksort slower than Mergesort?"

"Quicksort is not better than mergesort"

from question "Why is quicksort better than mergesort?"

"Why is quicksort better than mergesort"

from question "Is Quicksort a potential security risk?"

"Quicksort usually is better than mergesort for two reasons"

from question "When merge sort is preferred over Quick sort?"

Slower

"Mergesort is slightly slower than quicksort but it does not have quicksort s susceptibility to pathological cases"

from question "Manually sorting vector<int> in C++"

"I have been testing the practicality of openmp gnu parallel sort algorithms in the c++ standard library and have found the parallel quicksort algorithm to be significantly slower than the mergesort algorithm"

from question "Why is GNU parallel Quicksort so slow compared to Mergesort?"

"However on smaller int sizes quicksort gets slower and mergesort gets faster"

from question "Hand-coded quicksort is slower on smaller integers"

Algorithm faster

"The quicksort algorithm is faster than mergesort which is what sorted will get you when called on a sequence of objects via java.util.arrays.sort"

from question "How to sort lines on a value in them"

Less comparisons

"Mergesort uses about 30 less comparisons than quicksort"

from question "When merge sort is preferred over Quick sort?"

Better locality

"Quicksort has better locality of reference than mergesort which means that the accesses performed in quicksort are usually faster than the corresponding accesses in mergesort"

from question "When merge sort is preferred over Quick sort?"

Simpler

"Parallelizing mergesort is simpler than quicksort in-place"

from question "When to use merge sort and when to use quick sort?"

"I would say that the quicksort is simpler for parallelizing than the mergesort"

from question "Sorting a linked list in parallel using Insertion Sort"

Worse

"Scenarios when quicksort is worse than mergesort"

from question "When merge sort is preferred over Quick sort?"

More efficient

"Purely in terms of the number of comparisons performed is mergesort always more efficient than quicksort"

from question "Quicksort vs Mergesort in terms of comparisons"

Quicker

"That way quicksort can reach recursive base case more quicker than mergesort"

from question "Why is quicksort better than mergesort?"

Consistently less

"Quicksort consistently has less recursive calls than mergesort"

from question "Why is quicksort better than mergesort?"

Consistently faster

"Mergesort - in general mergesort is consistently faster than quicksort however quicksort is done in place and doesn t require allocating memory unlike mergesort"

from question "Is it sometimes better to write solution in O(n^2) than in O(n)?"

More

"Interestingly quicksort performs more comparisons on average than mergesort - 1.44 n lg n expected for quicksort versus n lg n for mergesort"

from question "Why is quicksort used in practice?"

Faster

"To be specific the quicksort runs faster than mergesort in the first test case and loses badly in the following 9 tests"

from question "Comparison of Mergesort & Quicksort with Linked List"

"For the 10 tests on the same list the results should be quite the same at least all showing that quicksort is faster than mergesort or vice vesa"

from question "Comparison of Mergesort & Quicksort with Linked List"

"In most cases quicksort will run faster than mergesort even though the worst-case execution time is longer"

from question "Which sorting algorithm is used in stl and .net base library default search?"

"It might be helpful to see why quicksort is usually faster than mergesort since if you understand the reasons you can pretty quickly find some cases where mergesort is a clear winner"

from question "When merge sort is preferred over Quick sort?"

"Quicksort is approximately 40 faster than mergesort on random data because of fewer data movements"

from question "QuickSort vs MergeSort on arrays of primitives in Java"

"Quicksort is usually faster than mergesort just because it s easier to code a tight implementation and the operations it does can go faster"

from question "Why is quicksort better than mergesort?"

"You can also see that for smaller collections quicksort is faster but then mergesort takes the lead but all of this is case specific so take your time to study all 4 algorithms"

from question "Sorting in O(n*log(n)) worst case"

"I have read that quicksort is much faster than mergesort in practise and the reason for this is the hidden constant"

from question "Exactly how many comparisons does merge sort make?"

"As many people have noted the average case performance for quicksort is faster than mergesort"

from question "Why is quicksort better than mergesort?"

"From what i ve read i was expecting quicksort to be faster than mergesort but on my code it is not so i assume there must be a problem with my quicksort algorithm"

from question "QuickSort vs MergeSort, what am I doing wrong?"

"Depending on where i look people say quicksort is faster than mergesort due to its locality of reference cache hits etc"

from question "Quicksort vs Mergesort in terms of comparisons"

"Normally quicksort is faster than mergesort which is faster than heapsort"

from question "How do different languages implement sorting in their standard libraries?"

"Quicksort is implemented well it is typically 2-3 times faster than mergesort or"

from question "Why is quicksort faster in average than others?"

Generally faster

"It s because that quicksort is generally faster that people use it instead of mergesort"

from question "Why is quicksort better than mergesort?"

"Quicksort generally runs faster than mergesort but under some circumstances it can degrade to quadratic running time"

from question "Efficient Sorting?"

Implementation callback function

Quality Example
Slower

"When comparison function is a callback function like in quicksort libc implementation quicksort is slower than mergesort by 15 on random input and 30 for already sorted array for 64 bit integers"

from question "Why is quicksort better than mergesort?"

Consistently faster

"When comparing my quicksort implementation with std sort on my compiler and my implementation of mergesort i noticed an odd pattern on large data sets when operating on 64 bit integers quicksort is consistently faster than mergesort"

from question "Hand-coded quicksort is slower on smaller integers"

Worst complexity stable

Quality Example
Better

"For example locality of references has influence on cache hits or misses which is the reason why quicksort performs better than mergesort"

from question "Big O(n logn) is not preferable over the O(n^2)"

"An interesting answer about this can be found at why is quicksort better than mergesort"

from question "A basic confusion on quicksort"

"I know mergesort is better since it is stable and doesn t have n 2 as worst case but i required to implement quicksort"

from question "Implementation of Quick Sort for ArrayList of Object using Comparator"

"For instance quicksort can outperform mergesort although mergesort is provably better than quicksort in the worst case"

from question "Non-deterministic polynomial solutions over deterministic polynomial solution"

Better time-behavior

"Technically mergesort has a better time-behavior î nlogn worst and average cases than quicksort î n 2 worst case î nlogn average case"

from question "QuickSort vs MergeSort, what am I doing wrong?"

More space

"Mergesort may use more space than quicksort i m not entirely sure and merge may be better for linkedlists"

from question "When to use sorts over another"

Worse

"Quicksort is worse complexity than mergesort in the worst case."

from question "Efficient traversal of a changelist"

"Given that it is possible to vastly reduce the likelihood of the worst case of quicksort s time complexity via random selection of the pivot for example i think one could argue that mergesort is worse in all but the pathological case of quicksort"

from question "Worse is better. Is there an example?"

Not better

"Quicksort is not better it is well suited for a different kind of application than mergesort"

from question "Why is quicksort better than mergesort?"

Others

Quality Example
Better

"That s hard to say.the worst of mergesort is n log2n -n+1 which is accurate if n equals 2 k i have already proved this .and for any n it s between n lg n - n + 1 and n lg n + n + o lg n .but for quicksort its best is nlog2n also n equals 2 k .if you divide mergesort by quicksort it equals one when n is infinite.so it s as if the worst case of mergesort is better than the best case of quicksort why do we use quicksort"

from question "Why is quicksort better than mergesort?"

"The biggest difference that can be produced between the two of them will always be to quicksort s detriment and it involves lists that are already largely sorted or contain a large number of ties when quicksort does better than mergesort the difference will not be nearly so great"

from question "Quicksort slower than Mergesort?"

More sensitive

"Quicksort is more sensitive to input sortedness in a positive way than mergesort"

from question "Why does order of mergesort and quicksort operations cause the second operation to run faster?"

Less swaps

"I do know though that quicksort has more compares but less swaps than mergesort which i learned from another stackoverflow discussion quicksort vs merge sort"

from question "* (no title is found for this review)"

Worse

"This means that while the two underlying sorts it uses mergesort and insertion sort are both worse than quicksort for many kinds of data timsort only uses them when it is advantageous to do so"

from question "Comparison between timsort and quicksort"

Quicker

"I had been taught that quicksort is almost always quicker than mergesort and i understand that there is some debate on this topic but i at least expected it to be closer than this"

from question "Quicksort slower than Mergesort?"

More optimal

"Also note that quicksort is generally more optimal than mergesort see this as well which explains why it s taken advantage of when sorting primitives"

from question "Arrays.sort() -- two different strategies for primitive & complex data types to be sorted"

Also more

"Quicksort is also more complicated than mergesort especially if you want to write a really solid implementation and so if you re aiming for simplicity and maintainability merge sort becomes a promising alternative with very little performance loss"

from question "Quick Sort Vs Merge Sort"

More natural

"Mergesort is more natural to implement for linked lists but you can do quicksort very nicely"

from question "Optimal Quicksort for Single Linked List"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0