Computational thinking and algorithms

GCSE Computer Science revision notes, key terms and practice questions.

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.

Practise Computational thinking and algorithms: 12 questions