Skip to content

Computational thinking and algorithms: GCSE Computer Science revision notes

Decomposition means breaking a problem down into smaller parts that are easier to solve.

In short

Decomposition means breaking a problem down into smaller parts that are easier to solve. Abstraction means removing unnecessary detail so you can focus on what matters. A map of the London Underground shows the stations and how they connect, but not the real distances.

For GCSE students in Years 10 and 11, on the AQA, OCR, Edexcel, Eduqas, Edexcel IGCSE and Cambridge IGCSE Computer Science courses.

Computational thinking

  • Decomposition means breaking a problem down into smaller parts that are easier to solve.
  • Abstraction means removing unnecessary detail so you can focus on what matters. A map of the London Underground shows the stations and how they connect, but not the real distances.
  • Algorithmic thinking means working out the steps needed to solve a problem, in the right order.

Algorithms

  • An algorithm is a sequence of steps that completes a task. A program is an algorithm written in a programming language, so a computer can run it.
  • Algorithms are built from three things: sequence (steps in order), selection (choosing a path, such as with IF) and iteration (repeating steps with a loop).
  • Before designing, identify the inputs, processes and outputs. For a program that works out the area of a rectangle, the inputs are the length and width, the process is length × width, and the output is the area.

Structure diagrams and trace tables

  • A structure diagram shows a problem broken down into smaller sub-problems, from the top down.
  • A trace table records the value of each variable as an algorithm runs, step by step. Working through an algorithm by hand like this (a dry run) helps you find errors.

Efficiency

  • More than one algorithm can solve the same problem. A more efficient algorithm takes fewer steps (less time) or uses less memory.
  • For example, a binary search finds an item in a large sorted list in far fewer steps than a linear search.

Key terms

Algorithm
A sequence of steps that completes a task.
Decomposition
Breaking a problem down into smaller, more manageable parts.
Abstraction
Removing unnecessary detail to focus on the important parts of a problem.
Algorithmic thinking
Working out the steps needed to solve a problem.
Sequence
Instructions carried out one after another, in order.
Selection
Choosing which path to follow, depending on a condition.
Iteration
Repeating a set of instructions.
Trace table
A table that records the values of variables as an algorithm runs.
Structure diagram
A diagram showing a problem broken down into sub-problems.

Quick questions on Computational thinking and algorithms

What is decomposition?
Breaking a problem into smaller, more manageable parts: Each small part is easier to solve.
What is abstraction?
Removing unnecessary detail to focus on what matters: It simplifies a problem.
A Tube map shows stations and lines but not real distances. Which technique is this?
Abstraction: Unneeded detail has been removed.
What is an algorithm?
A sequence of steps that completes a task: A recipe is an everyday example.
Which three building blocks are all algorithms made from?
Sequence, selection and iteration: Every algorithm can be written using just these three.
What is selection?
Choosing which path to follow, for example with IF: The path depends on a condition.
What is iteration?
Repeating a set of steps: Loops are used for iteration.
What is a trace table used for?
Recording the values of variables as an algorithm runs: It helps you find errors by hand.
A program asks for a length and a width, then displays the area. What is the output?
The area: The length and width are inputs.
What does a structure diagram show?
A problem broken down into smaller sub-problems: It is a picture of decomposition.
What makes one algorithm more efficient than another?
It solves the problem in fewer steps or with less memory: Efficiency is about time and memory.
What is the difference between an algorithm and a program?
A program is an algorithm written in a programming language: Algorithms can be written in pseudocode or drawn as flowcharts.

Computational thinking and algorithms: exam-style questions and mark schemes

  1. Which of these is an example of decomposition? [1 mark]

    Answer: Splitting a game into menus, gameplay and scoring

  2. Explain what is meant by abstraction, and give an example. [2 marks]

    • Removing or hiding unnecessary detail to focus on the important parts (1)
    • A valid example, e.g. a Tube map that shows stations but not real distances (1)
  3. A program asks the user for the number of hours worked and the hourly rate of pay, then displays the total pay. Identify the inputs, the process and the output. [3 marks]

    • Inputs: the hours worked and the hourly rate (1)
    • Process: multiply the hours by the rate (1)
    • Output: the total pay (1)
  4. Explain why a programmer might choose one algorithm over another that solves the same problem. [2 marks]

    • One algorithm may be more efficient: it takes fewer steps or less time (1)
    • Or it uses less memory, or is easier to understand and maintain (1)
  5. Explain decomposition, abstraction and algorithmic thinking, using the example of designing a satnav program that finds a route. [6 marks]

    • decomposition: breaking a problem into smaller parts
    • for example: get the destination, find possible routes, choose the best, give directions
    • each part is easier to solve and test on its own
    • abstraction: removing detail that isn't needed
    • for example, the map is stored as roads and junctions, not buildings or scenery
    • keeping only what matters, such as distances and speed limits
    • algorithmic thinking: working out the steps to solve each part
    • for example, an algorithm that compares the lengths of routes; it can be reused

How to answer them: exam technique and command words.

Computational thinking and algorithms: questions and answers

A program asks for a length and a width, then displays the area. What is the output?
The area. The length and width are inputs.
What does a structure diagram show?
A problem broken down into smaller sub-problems. It is a picture of decomposition.
What makes one algorithm more efficient than another?
It solves the problem in fewer steps or with less memory. Efficiency is about time and memory.

Practise Computational thinking and algorithms: 12 questions

Download these notes as a PDF

Next topic: Pseudocode and flowcharts

More in Fundamentals of algorithms

LycoLearn is still loading…

This can take a little longer on a busy school or home network. If nothing happens, try refreshing the page.

LycoLearn didn’t load properly

Part of it didn’t arrive. Try refreshing the page in a minute, or open LycoLearn in another browser.