Changes to Merge sort
TechWritereditor · 5 Dec 2026, 06:31 · “New page”
+ added − removed (first version)
Title
Removed:
Added: Merge sort
Short description
Removed:
Added: Divide-and-conquer sorting algorithm (1945)
Type
Removed:
Added: technology
Summary
Removed:
Added: Merge sort is a sorting algorithm that splits a list into parts, sorts them and merges the sorted parts back together. John von Neumann proposed it in 1945, making it one of the oldest computer algorithms.
Fact box
Removed:
Added: Type: Sorting algorithm
Added: Inventor: John von Neumann
Added: Introduced: 1945
Added: Method: Divide and conquer
Added: Running time: Proportional to n log n
Added: Extra memory: Proportional to n (standard version)
Article
Added: **Merge sort** is a sorting algorithm that puts a list of items in order by splitting it into smaller parts, sorting those parts and then merging the sorted parts back together. It is one of the oldest computer algorithms, proposed by [[John von Neumann]] in 1945.[^1]
Added: ## History
Added: Von Neumann wrote a sorting program by hand in 1945 while refining the design of the [[EDVAC]], an early stored-program computer.[^1] Rather than solving a numerical problem, the program was meant to test whether the proposed instruction set could handle logical tasks such as rearranging data.[^1] It is thought to be the earliest surviving program written for a stored-program digital computer, and the method it uses is the one now known as merge sort.[^1] The computer scientist Donald Knuth analysed the program in a 1970 article, "Von Neumann's First Computer Program", in the journal Computing Surveys, and in his book The Art of Computer Programming he credits von Neumann with proposing merge sort in 1945.[^1][^2]
Added:
Added: ## How it works
Added: The usual two-way version divides the items into two groups, sorts each group by applying the same method to it (a technique called recursion), and then merges the two sorted groups into one ordered list.[^3] Merging is straightforward: the two sorted halves are copied to a working area and combined back into the original list in order.[^4] A "bottom-up" version avoids recursion by first merging single items into pairs, then pairs into groups of four, and so on until the whole list is sorted.[^4]
Added:
Added: Merge sort is guaranteed to sort n items in time proportional to n log n, whatever the starting order of the input, and no sorting method that works by comparing items can guarantee to do much better.[^3][^4] Its main drawback is that the standard version needs extra working memory in proportion to the number of items.[^4] Practical versions often switch to a simpler method for very small groups, which can make them 10 to 15 per cent faster.[^4] Specialised variants include k-way and polyphase merge sorts.[^3]
Added:
Added: ## Use
Added: Merge sort appears in real-world software libraries. For example, the documentation for the Java programming language's standard library names merge sort when describing its method for sorting objects, which must be stable: items that compare as equal keep their original order.[^5]
Added:
Added: ## See also
Added: - [[Quicksort]]
Added: - [[Dijkstra's algorithm]]
Added: - [[ENIAC]]
Sources
Removed:
Added: Von Neumann's First Computer Program (Donald E. Knuth, Computing Surveys, 1970) | https://fermatslibrary.com/s/von-neumanns-first-computer-program | Fermat's Library
Added: Merge Sort | https://mathworld.wolfram.com/MergeSort.html | Wolfram MathWorld
Added: merge sort | https://xlinux.nist.gov/dads/HTML/mergesort.html | NIST Dictionary of Algorithms and Data Structures | 2023-04-06
Added: Mergesort (Algorithms, 4th Edition) | https://algs4.cs.princeton.edu/22mergesort/ | Princeton University
Added: Arrays (Java Platform SE 8) | https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html | Oracle
Categories
Removed:
Added: Algorithms
Other names
Removed:
Added: Mergesort
Added: Merge-sort
Added: Two-way merge sort