Professional Documents
Culture Documents
They should be able to explain and carry out a merge sort in an exam. Splitting the array
An algorithm will take an array
Step 1: Split the arrays into
3 2 7 1 8 5 6 4 It then finds the midpoint and splits the array into 2 arrays
sub-arrays of 1 element.
If the mid-point is not a whole number (e.g. mid-point of 9 is 4.5)
then you can either use 4 or 5 as the mid-point.
3 2 7 1 8 6 This process is repeated until all we have left are sub-arrays of 1
5 4 item.
Tip: Not all arrays will have an even number of elements. You will need to
1 2 3 7 4 5 6
8 practise using a Merge Sort on both even and uneven numbers of elements
in an array.
Note: OCR Exam Reference Language loops are inclusive when creating the boundary limits, i.e. for x = 0 to 9 will loop 10 times.
Looking for a resource? There is now a quick and easy search tool to help find free resources for your qualification: www.ocr.org.uk/i-want-to/find-resources/
Our documents are updated over time. Whilst every effort is made to check all documents, there may be contradictions between published support and the specification, therefore please use the
information on the latest specification at all times. Where changes are made to specifications these will be indicated within the document, there will be a new version number indicated, and a summary of
the changes. If you do notice a discrepancy between the specification and a resource, please contact us at: resources.feedback@ocr.org.uk.
© OCR 2020 - This resource may be freely copied and distributed, as long as the OCR logo and this message remain intact and OCR is acknowledged as the originator of this work. OCR acknowledges
the use of the following content: n/a
Please get in touch if you want to discuss the accessibility of resources we offer to support delivery of our qualifications: resources.feedback@ocr.org.uk