Searching and Sorting Algorithms | Edexcel International GCSE Computer Science (4CP0)

Guide overview All 20 topics Sample questions Papers and weighting Look inside Questions and answers

Searching and Sorting Algorithms

  • 26 questions
  • 3 subtopics
  • Paper 1
  • Paper 2

Searching and Sorting Algorithms is examined in Paper 1, Principles of Computer Science, and Paper 2, Application of Computational Thinking.

It covers linear search and binary search; bubble sort; and merge sort.

Sample questions from Searching and Sorting Algorithms

Answer each one closed book first, then open the answer.

  1. Linear search and binary search

    How does a linear search work?

    Show the answer
    A linear search checks each item in the list in turn, starting at the first. The search stops when the item is found or the end of the list is reached.
  2. Linear search and binary search

    Search the sorted list 3, 8, 12, 19, 25, 31, 40 for 25 using a binary search.

    Show the answer
    The sorted list 3, 8, 12, 19, 25, 31, 40 has 19 as its middle item. The target 25 is larger, so 19 and the left half are discarded. The middle of 25, 31, 40 is 31, and 25 is smaller, so 31 and 40 are discarded. The item 25 is checked next and found.
  3. Bubble sort

    How does a bubble sort work?

    Show the answer
    A bubble sort compares each pair of adjacent items and swaps them if they are in the wrong order. Passes through the list repeat until no swaps are needed.
  4. Bubble sort

    How can a bubble sort be made more efficient?

    Show the answer
    A flag records whether any swap happened during a pass, so the sort stops as soon as a pass makes no swaps. Each pass can also stop one place earlier, because the end is already sorted.
  5. Merge sort

    How does a merge sort work?

    Show the 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.
  6. Merge sort

    Give one advantage and one disadvantage of a merge sort.

    Show the 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.

The 3 subtopics

One subtopic is one session. Work down the list.

Subtopic What it covers Questions
Linear search and binary search How linear and binary searches work, worked binary searches, the number of comparisons each needs, and when each suits the data. 10
Bubble sort How a bubble sort compares and swaps adjacent items, a worked first pass, how a flag makes it efficient, and its strengths and limits. 8
Merge sort 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. 8
Searching and Sorting Algorithms is 26 of the 819 questions in the guide.Get the guide, £7

How the guide is worked

Answering a question from memory stores it far better than reading the answer again. The guide runs that as a fixed procedure on one subtopic at a time, about twenty minutes a session.

  1. Step 1 · Closed book

    Cover the answers. Work through one subtopic and write down what you can. Leave blanks where you have nothing.

  2. Step 2 · Open book

    Go back to the top. Read each printed answer and write it out in full, including the ones you had right.

  3. Step 3 · Closed book again

    Same questions, same order, from memory. The gap between pass one and pass three is the session result.

Read the full method, the return schedule and the research behind it.

Around this topic

All 20 topics Guide overview

Edexcel International GCSE Computer Science Active Recall Guide

Searching and Sorting Algorithms and every other topic, with the answers printed after each section.

£7 GBP
Get the guide

Digital PDF, sent to the email address on your order.