Lesson 2.1.3

2.1.3 Searching and sorting algorithms Quiz: OCR Computer Science, Unit 7

20 questions

In partnership with Revision Ninja

Lesson 2.1.3, Searching and sorting algorithms: 20 multiple choice questions for the OCR GCSE Computer Science (J277), Unit 7: 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 must be true about a list before performing a binary search?

    • It contains numbers
    • It is empty
    • It is sorted
    • It is randomised
  2. Which search algorithm checks each item in turn until the target is found?

    • Linear search
    • Merge search
    • Binary search
    • Bubble search
  3. How does binary search narrow down the search space on each comparison?

    • Discards one item
    • Discards a quarter
    • Reverses the list
    • Discards half
  4. Which sorting algorithm repeatedly compares adjacent items and swaps them if out of order?

    • Binary sort
    • Bubble sort
    • Insertion sort
    • Merge sort
  5. Which sorting algorithm splits a list into halves and combines them back in order?

    • Bubble sort
    • Merge sort
    • Insertion sort
    • Linear sort
  6. Which sorting algorithm builds a sorted section by placing each new item into position?

    • Insertion sort
    • Binary sort
    • Merge sort
    • Bubble sort
  7. After one complete pass of a bubble sort, which item is guaranteed to be in its final position?

    • Smallest item
    • Median item
    • First item
    • Largest item
  8. Which search algorithm can be used successfully on an unsorted list?

    • Hash search
    • Linear search
    • Binary search
    • Indexed search
  9. A list is 2, 5, 8, 12, 16, 23, 38, 56, 72, 91. How many comparisons does a binary search need to find 23?

    • 3
    • 10
    • 2
    • 5
  10. Using the same list 2, 5, 8, 12, 16, 23, 38, 56, 72, 91, how many comparisons does a linear search need to find 72?

    • 7
    • 8
    • 10
    • 9
  11. What is the list after one pass of bubble sort on 5, 3, 8, 1?

    • 5, 3, 1, 8
    • 1, 3, 5, 8
    • 3, 5, 1, 8
    • 3, 5, 8, 1
  12. The sorted section is 4. The next item, 2, is inserted into the correct place. What is the sorted section now?

    • 4, 2
    • 2
    • 2, 4
    • 4
  13. Splitting 6, 2, 9, 4 gives 6, 2 and 9, 4. Each part is sorted to give 2, 6 and 4, 9. What does merging them give?

    • 6, 2, 9, 4
    • 2, 6, 4, 9
    • 2, 4, 6, 9
    • 4, 2, 6, 9
  14. A programmer needs to find a name in an alphabetically sorted directory, and speed matters. Which algorithm is best?

    • Linear search
    • Bubble sort
    • Binary search
    • Insertion sort
  15. Which search type is most efficient for a single lookup in a large unsorted list?

    • Linear search
    • Bubble search
    • Merge search
    • Binary search
  16. A loop repeatedly compares each pair of neighbouring items, swaps them if out of order, and makes passes until no swaps occur. Which algorithm is this?

    • Bubble sort
    • Linear search
    • Merge sort
    • Binary search
  17. Why is binary search faster than linear search on large ordered datasets?

    • Halves the data
    • Skips random items
    • Uses parallel processing
    • Removes duplicates
  18. Why is merge sort generally more efficient than bubble sort on large lists?

    • Fewer comparisons
    • More memory
    • Simpler code
    • Faster hardware
  19. Why is an insertion sort very efficient when used on a nearly sorted list?

    • Lists split equally
    • Pivots are central
    • Few items move
    • No items move
  20. After several passes of bubble sort, what does an unsorted list suggest?

    • List is sorted
    • Algorithm failed
    • Memory is full
    • More passes needed

All OCR Computer Science quizzes