levo

Searching and Sorting Algorithms

Merge sort

  • 3 things to know
  • Papers 1 and 2
Start revising · £5/month

Overview

How a merge sort splits a list into single items and merges them in order, a worked example, and when it beats a bubble sort.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Show how a merge sort orders 6, 3, 8, 1

Process

How does a merge sort work?

Key term

Why is a list of one item already sorted?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    How does a merge sort work?

    Model answer

    A merge sort splits the list in half repeatedly until each part holds one item. The parts are then merged back together in order.

  2. 2

    Why is a list of one item already sorted?

    Model answer

    A single item has nothing to be compared with, so it is in order by definition. The merge sort builds sorted lists from these single items.

  3. 3

    How are two sorted lists merged?

    Model answer

    The first items of each list are compared and the smaller is moved to the new list. The comparison repeats until both lists are empty.

  4. 4

    Show how a merge sort orders 6, 3, 8, 1.

    Model answer

    The list splits into 6, 3 and 8, 1, then into single items. Pairs merge into 3, 6 and 1, 8. The final merge gives 1, 3, 6, 8.

  5. 5

    Give one advantage and one disadvantage of a merge sort.

    Model answer

    A merge sort is much faster than a bubble sort on large lists. A merge sort needs extra memory to hold the split lists and is harder to code.

  6. 6

    Which sorting algorithm suits a list of a million items, and why?

    Model answer

    A merge sort is the best choice for a million items. The number of comparisons grows far more slowly than in a bubble sort.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

Denary is a base system.
1028

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Nibble means a group of four bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Searching and Sorting Algorithms, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.