Merge algorithm: Difference between revisions

Content deleted Content added
Undid revision 821489112 by Duvavic1 (talk) self-cite? blog. Corman should be enough
Application: no reason for this image to have such nonstandard formatting
Line 2:
 
== Application ==
[[File:Merge sort algorithm diagram.svg|centre|thumb|upright=1.5|An example for merge sort]]
The merge algorithm plays a critical role in the [[merge sort]] algorithm, a [[comparison sort|comparison-based sorting algorithm]]. Conceptually, merge sort algorithm consists of two steps:
 
Line 8 ⟶ 9:
 
The merge algorithm is used repeatedly in the merge sort algorithm.
[[File:Merge sort algorithm diagram.svg|centre|thumb|An example for merge sort]]
 
An example merge sort is given above. It starts with an unsorted array of 7 integers. The array is divided into 7 partitions; each partition contains 1 element and is sorted. The sorted partitions are then merged to produce larger, sorted, partitions, until 1 partition, the sorted array, is left.