All exams← All GCSE Computer Science (Edexcel) notes

Algorithms & computational thinking: GCSE Computer Science (Edexcel) revision notes

Revision notes

What is computational thinking?

Computational thinking means breaking a problem down so a computer (or a person) can solve it logically. Edexcel expects you to use four key skills: decomposition, abstraction, pattern recognition and algorithmic thinking.

  • Decomposition: splitting a big problem into smaller, manageable sub-problems.
  • Abstraction: removing unnecessary detail and keeping only what matters for the solution.
  • Pattern recognition: spotting similarities between problems or within data so you can reuse a solution.
  • Algorithmic thinking: designing a step-by-step set of instructions (an algorithm) to solve the problem.

Representing algorithms

You must be able to read, trace and write algorithms shown as pseudocode and flowcharts. Common flowchart symbols: oval = start/end (terminator), parallelogram = input/output, rectangle = process, diamond = decision. Pseudocode uses keywords like IF, ELSE, WHILE, FOR, INPUT, OUTPUT similar to the exam board's own pseudocode guide.

Searching algorithms

  • Linear search: checks every item in turn from the start until found or the list ends. Works on unsorted or sorted lists. Worst case checks all n items.
  • Binary search: only works on a SORTED list. Repeatedly checks the middle item and halves the search space. Much faster on large lists (searches roughly log2(n) times rather than n times).

Sorting algorithms

  • Bubble sort: repeatedly compares adjacent pairs and swaps them if out of order, passing through the list until no swaps are needed. Simple but slow on large lists.
  • Merge sort: splits the list in half repeatedly (down to single items) then merges the halves back together in order. Faster than bubble sort on large data sets because it uses a divide-and-conquer approach.

Trace tables

Exam questions often give you an algorithm and ask you to complete a trace table showing how variable values change on each iteration. Work through the algorithm line by line, updating a row every time a variable changes, and note any OUTPUT produced.

Common mistakes

  • Forgetting binary search needs a sorted list first.
  • Mixing up decomposition (breaking down the problem) with abstraction (removing detail) — they are different skills.
  • Losing marks in trace tables by skipping a step or not showing every variable change.
  • Writing pseudocode with real programming language syntax (like Python's colons or semicolons) instead of the general pseudocode style expected.
  • Confusing efficiency: bubble sort is easy to write but inefficient; merge sort is efficient but more complex to trace.

Key facts

Flashcards

What are the four computational thinking skills?
Decomposition, abstraction, pattern recognition, algorithmic thinking.
tap to reveal
Define decomposition.
Breaking a large problem down into smaller, more manageable sub-problems.
tap to reveal
Define abstraction.
Removing unnecessary detail from a problem, keeping only what is relevant to the solution.
tap to reveal
What does pattern recognition involve?
Spotting similarities between problems or data so an existing solution can be reused.
tap to reveal
What is algorithmic thinking?
Designing a clear, step-by-step set of instructions (an algorithm) to solve a problem.
tap to reveal
How does a linear search work?
It checks every item in turn from the start of the list until the target is found or the list ends.
tap to reveal
What condition must be true for binary search to work?
The list must already be sorted.
tap to reveal
How does binary search find an item?
It repeatedly checks the middle item of the remaining list and halves the search space each time.
tap to reveal
Why is binary search usually faster than linear search on large lists?
Because it eliminates half the remaining items at each step instead of checking one at a time.
tap to reveal
How does bubble sort work?
It repeatedly compares adjacent items and swaps them if out of order, repeating passes until no swaps are needed.
tap to reveal
How does merge sort work?
It splits the list in half repeatedly down to single items, then merges the halves back together in sorted order.
tap to reveal
Which sort is generally more efficient on large data sets, bubble sort or merge sort?
Merge sort, because it uses a divide-and-conquer approach.
tap to reveal
What does a diamond symbol represent in a flowchart?
A decision point.
tap to reveal
What does a parallelogram symbol represent in a flowchart?
Input or output.
tap to reveal
What is a trace table used for?
Recording how variable values (and any output) change as an algorithm executes step by step.
tap to reveal
Practice questions

Algorithms & computational thinking: 5 practice questions

Q1. What is 'decomposition' in computational thinking?
  • A.  Testing a program with a range of different inputs
  • B.  Breaking a complex problem down into smaller, more manageable sub-problems
  • C.  Writing a program in a low-level language
  • D.  Removing unnecessary detail from a problem to focus on what matters
Show answer & explanation
✓ Answer: B. Breaking a complex problem down into smaller, more manageable sub-problems
Decomposition means splitting a large problem into smaller parts that are easier to design, code and test individually. Abstraction (option B) is a different technique — it means ignoring irrelevant detail, not splitting the problem up.
Q2. What is 'abstraction' in computational thinking?
  • A.  Repeating a set of instructions until a condition is met
  • B.  Converting a flowchart into pseudocode
  • C.  Breaking a problem into smaller sub-problems
  • D.  Removing unnecessary detail so only the information relevant to solving the problem remains
Show answer & explanation
✓ Answer: D. Removing unnecessary detail so only the information relevant to solving the problem remains
Abstraction involves filtering out details that are not needed to solve the problem, creating a simplified model. This is different from decomposition, which splits the problem into parts rather than simplifying it.
Q3. A programmer identifies that a large 'manage library system' problem can be split into 'add book', 'remove book', 'search catalogue' and 'issue loan'. Which computational thinking technique is being used?
  • A.  Algorithmic thinking
  • B.  Decomposition
  • C.  Pattern recognition
  • D.  Abstraction
Show answer & explanation
✓ Answer: B. Decomposition
Splitting one large task into smaller, self-contained sub-tasks is decomposition. Pattern recognition would instead involve spotting similarities between this problem and previously solved ones.
Q4. What is 'pattern recognition' in computational thinking?
  • A.  Spotting similarities or trends between and within problems
  • B.  Drawing a flowchart to represent an algorithm
  • C.  Testing code with boundary data
  • D.  Ignoring detail that is not relevant to the problem
Show answer & explanation
✓ Answer: A. Spotting similarities or trends between and within problems
Pattern recognition means noticing common features or repeated trends across problems, which helps reuse solutions or spot rules. It is not about drawing diagrams or simplifying detail, which are other stages of computational thinking.
Q5. Which of these best defines an algorithm?
  • A.  The hardware that executes a computer program
  • B.  A precise, ordered sequence of steps to solve a problem or complete a task
  • C.  Any diagram that models a computer system
  • D.  A programming language used to write code
Show answer & explanation
✓ Answer: B. A precise, ordered sequence of steps to solve a problem or complete a task
An algorithm is a step-by-step, unambiguous set of instructions for solving a problem, independent of any particular programming language. A flowchart or pseudocode is simply one way of representing an algorithm, not the algorithm's definition.
Test yourself
See the GCSE Computer Science (Edexcel) page

More GCSE Computer Science (Edexcel) topics