Merge sort splits items in lists into individual lists before merging pairs of lists together till all items are sorted.
Merge sort is an efficient “divide and conquer” algorithm that can perform well in real world use.
A merge sort algorithm is usually faster to execute but more complex to write than bubble sort.
Executing a merge sort takes up extra space in memory.
Keywords
merge sort
a sorting algorithm that works by repeatedly splitting data into sublists and merging pairs of sublists, ordering the items as they are merged
splitting
the initial step of dividing an unsorted list into smaller sublists
merging
the process of combining two already sorted lists into a single, larger sorted list
A common mistake
Mistake:Merge sort is the most efficient sorting algorithm for all cases.
In fact:For smaller data sets, simpler algorithms such as insertion sort or bubble sort can be faster due to the overhead in merge sort of having to break apart the data to be sorted.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.Read the licence
The wording comes from each publisher. The layout and the links to your syllabus are ours.