|
1 | 1 | # Merge Sort
|
2 | 2 |
|
3 |
| -In computer science, merge sort (also commonly spelled |
4 |
| -mergesort) is an efficient, general-purpose, |
5 |
| -comparison-based sorting algorithm. Most implementations |
6 |
| -produce a stable sort, which means that the implementation |
7 |
| -preserves the input order of equal elements in the sorted |
8 |
| -output. Mergesort is a divide and conquer algorithm that |
| 3 | +_Read this in other languages:_ |
| 4 | +[_한국어_](README.ko-KR.md) |
| 5 | + |
| 6 | +In computer science, merge sort (also commonly spelled |
| 7 | +mergesort) is an efficient, general-purpose, |
| 8 | +comparison-based sorting algorithm. Most implementations |
| 9 | +produce a stable sort, which means that the implementation |
| 10 | +preserves the input order of equal elements in the sorted |
| 11 | +output. Mergesort is a divide and conquer algorithm that |
9 | 12 | was invented by John von Neumann in 1945.
|
10 | 13 |
|
11 |
| -An example of merge sort. First divide the list into |
12 |
| -the smallest unit (1 element), then compare each |
13 |
| -element with the adjacent list to sort and merge the |
14 |
| -two adjacent lists. Finally all the elements are sorted |
| 14 | +An example of merge sort. First divide the list into |
| 15 | +the smallest unit (1 element), then compare each |
| 16 | +element with the adjacent list to sort and merge the |
| 17 | +two adjacent lists. Finally all the elements are sorted |
15 | 18 | and merged.
|
16 | 19 |
|
17 | 20 | 
|
18 | 21 |
|
19 |
| -A recursive merge sort algorithm used to sort an array of 7 |
20 |
| -integer values. These are the steps a human would take to |
| 22 | +A recursive merge sort algorithm used to sort an array of 7 |
| 23 | +integer values. These are the steps a human would take to |
21 | 24 | emulate merge sort (top-down).
|
22 | 25 |
|
23 | 26 | 
|
|
0 commit comments