Lesson 4.3.5.2

4.3.5.2 Merge sort Quiz: AQA Computer Science, Unit 3

20 questions

In partnership with Revision Ninja

Lesson 4.3.5.2, Merge sort: 20 multiple choice questions for the AQA Computer Science (7517), Unit 3: Fundamentals of algorithms, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is the time complexity of merge sort?

    • O(n log n)
    • O(log n)
    • O(n log n squared)
    • O(n^2)
  2. Merge sort is an example of which approach to problem solving?

    • Dynamic programming only
    • Greedy
    • Brute force
    • Divide and conquer
  3. What does merge sort do first with a list?

    • Scans the list for duplicate values
    • Divides the list into smaller halves until each part holds a single item
    • Creates a binary tree of comparisons between every pair of items in the list
    • Finds the largest item
  4. In the merge step of merge sort, what happens?

    • Items are swapped until the list is reversed
    • Two lists are joined end to end without comparison
    • The largest item is removed from each list
    • Two sorted lists are combined by repeatedly taking the smaller front item
  5. Why is merge sort O(n log n) while bubble sort is O(n^2)?

    • Merge sort compares each item only once overall, so it runs in linear time for every list
    • Merge sort never swaps items
    • Merge sort halves the list about log n times, and each level of merging costs O(n)
    • Merge sort uses a fixed number of passes
  6. What extra storage does merge sort typically need during merging?

    • Auxiliary space proportional to n
    • No extra storage
    • A single constant variable
    • Space proportional to n squared
  7. Merge two sorted lists [1, 4, 7] and [2, 3, 8]. What is the result?

    • [1, 2, 3, 4, 8, 7]
    • [1, 2, 3, 4, 7, 8]
    • [2, 3, 1, 4, 7, 8]
    • [1, 4, 7, 2, 3, 8]
  8. How many times can an 8-item list be halved before single items remain?

    • 8
    • 4
    • 2
    • 3
  9. What is the sorted output of merge sort applied to [38, 27, 43, 3]?

    • [3, 38, 27, 43]
    • [38, 27, 3, 43]
    • [27, 3, 38, 43]
    • [3, 27, 38, 43]
  10. Merging the sorted lists [2, 6, 9] and [1, 5] with the standard merge step, what is the first item output?

    • 2
    • 1
    • 9
    • 5
  11. What is the maximum number of comparisons needed to merge two sorted lists of lengths 4 and 4?

    • 8
    • 16
    • 4
    • 7
  12. How many halving levels does merge sort use for 1024 items?

    • 1024
    • 512
    • 10
    • 5
  13. Roughly how many operations does merge sort need for n = 1024 items?

    • 1048576
    • 10240
    • 1024
    • 523776
  14. Compared with bubble sort on the same 1024 items, merge sort needs roughly how many times fewer operations?

    • About 2 times
    • About 10 times
    • About 50 times
    • About 1000 times
  15. Why is the merge step stable when ties are resolved in favour of the left list?

    • The sort becomes O(n^2)
    • Equal items keep their original relative order
    • Equal items are removed from the result
    • Items are reversed during the merge
  16. What is the recursion depth of merge sort on n items?

    • n levels
    • Exactly two levels
    • n squared levels
    • About log2 n levels
  17. Roughly how many comparisons does merge sort need to sort 1000 items?

    • About 1,000,000
    • About 1,000
    • About 10,000
    • About 100,000
  18. Which is a valid reason to prefer merge sort over bubble sort for large data sets?

    • Merge sort never needs any comparisons
    • Bubble sort cannot run on modern computers
    • Merge sort uses less memory than any algorithm
    • Its O(n log n) growth keeps running time manageable as n increases
  19. A merge sort sorts 16 items. How many merge operations occur in total?

    • 16
    • 8
    • 15
    • 4
  20. What is the running time of merge sort on a list that is already sorted?

    • O(1)
    • O(n^2)
    • O(n), because it stops early
    • O(n log n), because it still divides and merges

All AQA Computer Science quizzes