Lesson 4.3.5.1

4.3.5.1 Bubble sort Quiz: AQA Computer Science, Unit 3

20 questions

In partnership with Revision Ninja

Lesson 4.3.5.1, Bubble 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 bubble sort?

    • O(n log n)
    • O(n)
    • O(n^2)
    • O(log n)
  2. In bubble sort, what happens to adjacent items that are out of order?

    • They are swapped
    • They are merged
    • They are ignored
    • They are deleted
  3. After one complete pass of bubble sort, what is guaranteed?

    • The list is fully sorted
    • The smallest item is at the front
    • The list is reversed
    • The largest item has reached its final position at the end
  4. Why does the specification describe bubble sort as an inefficient sorting algorithm?

    • It cannot sort numbers
    • It uses too much memory
    • It is time-inefficient, with O(n^2) growth in comparisons
    • It requires a tree structure
  5. How does bubble sort work?

    • It inserts each item into a binary tree
    • It splits the list in half and merges sorted halves
    • It selects the middle item and partitions around it
    • It repeatedly compares adjacent pairs and swaps those that are out of order
  6. Which sorting algorithm is included in the specification as a particularly inefficient example?

    • Binary tree sort
    • Merge sort
    • Dijkstra sort
    • Bubble sort
  7. Bubble sort is applied to [5, 1, 4, 2, 8]. What is the list after the first pass?

    • [1, 5, 4, 2, 8]
    • [1, 2, 4, 5, 8]
    • [1, 4, 2, 5, 8]
    • [5, 1, 4, 2, 8]
  8. Bubble sort is applied to [5, 1, 4, 2, 8]. What is the list after two passes?

    • [1, 2, 4, 5, 8]
    • [2, 1, 4, 5, 8]
    • [1, 4, 2, 5, 8]
    • [1, 2, 4, 8, 5]
  9. How many swaps does bubble sort perform in total while sorting [5, 1, 4, 2, 8]?

    • 4
    • 3
    • 5
    • 2
  10. How many comparisons are made in the first pass of bubble sort on a list of 10 items?

    • 8
    • 9
    • 45
    • 10
  11. How many comparisons does a complete bubble sort of n items make without an early-exit check?

    • n + 1
    • log2 n
    • 2n
    • n(n - 1) / 2
  12. With an early-exit check that stops when a pass makes no swaps, how many passes are needed to confirm an already sorted list of 10 items?

    • 10
    • 1
    • 9
    • 2
  13. If the number of items in a bubble sort doubles, roughly how does the running time change?

    • It doubles
    • It increases by a fixed amount
    • It roughly quadruples
    • It is unchanged
  14. How many swaps does bubble sort need to sort the reverse-ordered list [4, 3, 2, 1]?

    • 3
    • 10
    • 6
    • 4
  15. For a list of 100 distinct items in reverse order, how many swaps does bubble sort perform?

    • 4950
    • 99
    • 100
    • 9900
  16. Which statement best explains why bubble sort is a poor choice for a list of one million items?

    • It requires the list to be stored as a tree
    • It uses too much memory
    • It cannot sort numbers
    • Its roughly n^2 comparisons grow far faster than n log n, making run time impractical
  17. When bubble sort compares two equal adjacent values, what should it do to keep the sort stable?

    • Leave them in place
    • Compare them with a third value
    • Swap them so their order is reversed
    • Delete one of them
  18. Bubble sort is applied to [3, 7, 2]. What is the list after the first pass?

    • [2, 3, 7]
    • [3, 7, 2]
    • [3, 2, 7]
    • [7, 3, 2]
  19. Roughly how many comparisons does a worst-case bubble sort of 1024 items make?

    • 1,048,576
    • 523,776
    • 10,240
    • 1,023
  20. A bubble sort is applied to a list that is already sorted, without the early-exit optimisation. How many swaps occur?

    • 0
    • n - 1
    • 1
    • n(n - 1) / 2

All AQA Computer Science quizzes