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

Worst complexity stable

Implementation callback function

Quality | Example |
---|---|

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" |

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?" |

Algorithm comparisons specific

Others