An example of merge sort. First, divide the list into the smallest unit (1 element), then compare each element with the adjacent list to sort and merge the two adjacent lists. Finally, all the elements are sorted and merged.
Class
Sorting algorithm
Data structure
Array
Worst-case performance
Best-case performance
typical,
natural variant
Average performance
Worst-case space complexity
total with auxiliary, auxiliary with linked lists[1]
In computer science, merge sort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the relative order of equal elements is the same in the input and output. Merge sort is a divide-and-conquer algorithm that was invented by John von Neumann in 1945.[2] A detailed description and analysis of bottom-up merge sort appeared in a report by Goldstine and von Neumann as early as 1948.[3]
^Skiena (2008, p. 122)
^Knuth (1998, p. 158)
^Katajainen, Jyrki; Träff, Jesper Larsson (March 1997). "Algorithms and Complexity". Proceedings of the 3rd Italian Conference on Algorithms and Complexity. Italian Conference on Algorithms and Complexity. Lecture Notes in Computer Science. Vol. 1203. Rome. pp. 217–228. CiteSeerX 10.1.1.86.3154. doi:10.1007/3-540-62592-5_74. ISBN 978-3-540-62592-6.
In computer science, mergesort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations...
A polyphase mergesort is a variation of a bottom-up mergesort that sorts a list using an initial uneven distribution of sub-lists (runs), primarily used...
Oscillating mergesort or oscillating sort is a variation of mergesort used with tape drives that can read backwards. Instead of doing a complete distribution...
sorting is important for optimizing the efficiency of other algorithms (such as search and merge algorithms) that require input data to be in sorted lists...
distribution sorting, which resembles quicksort, and external mergesort, which resembles mergesort. External mergesort typically uses a hybrid sort-merge strategy...
Cascade mergesort is similar to the polyphase mergesort but uses a simpler distribution. The merge is slower than a polyphase merge when there are fewer...
more advanced algorithms such as quicksort, heapsort, or mergesort. However, insertion sort provides several advantages: Simple implementation: Jon Bentley...
Block sort, or block mergesort, is a sorting algorithm combining at least two merge operations with an insertion sort to arrive at O(n log n) (see Big...
inputs lists in sorted order. These algorithms are used as subroutines in various sorting algorithms, most famously mergesort. The merge algorithm plays...
More efficient algorithms such as quicksort, timsort, or mergesort are used by the sorting libraries built into popular programming languages such as...
Timsort is a hybrid, stable sorting algorithm, derived from mergesort and insertion sort, designed to perform well on many kinds of real-world data....
1961. It is still a commonly used algorithm for sorting. Overall, it is slightly faster than mergesort and heapsort for randomized data, particularly...
considered to be a sorted list of one element, and continues through all the columns until the last merges them into a single, sorted list. Because the...
shaker sort is used primarily as an educational tool. More performant algorithms such as quicksort, mergesort, or timsort are used by the sorting libraries...
Finally, sort the two segments recursively. Mergesort: Divide the list of elements in two parts, sort the two parts individually and then merge it. Various...
Radix sort in C# with source in GitHub Video tutorial of MSD Radix Sort Demonstration and comparison of Radix sort with Bubble sort, Mergesort and Quicksort...
used as well, such as selection sort or mergesort. Using bucketSort itself as nextSort produces a relative of radix sort; in particular, the case n = 2...
input Sorting linked lists (in which case mergesort requires minimal extra space) Parallel sorting; mergesort parallelizes even better than quicksort...
The Sort/Merge utility is a mainframe program to sort records in a file into a specified order, merge pre-sorted files into a sorted file, or copy selected...
The SortMerge Generator was an application developed by Betty Holberton in 1951 for the Univac I and is one of the first examples of using a computer...
under UNIX Merge (SQL), a statement in SQL Merge algorithm, an algorithm for combining two or more sorted lists into a single sorted one Mail merge, the production...