All exams← All GCSE Computer Science (OCR) notes

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

Revision notes

What counts as computational thinking

OCR splits this into decomposition, abstraction and algorithmic thinking.

  • Decomposition: breaking a big problem into smaller sub-problems that are easier to solve.
  • Abstraction: removing unnecessary detail and keeping only what matters for the problem.
  • Algorithmic thinking: designing the ordered steps (the algorithm) that solve the problem.

An algorithm is a precise, finite sequence of steps that solves a problem or completes a task. It must be unambiguous, have a clear start and end, and terminate.

Representing algorithms

OCR expects you to read and write algorithms in three forms:

  • Flowcharts: use standard symbols. Oval = start/stop, rectangle = process, parallelogram = input/output, diamond = decision (always has two exits, usually yes/no).
  • Pseudocode: structured English-like code using sequence, selection (IF/ELSE) and iteration (FOR/WHILE), similar in style to the OCR Exam Reference Language.
  • Structured English: numbered plain-language steps.

All three must show the same three constructs: sequence (steps in order), selection (decisions/branches) and iteration (loops).

Searching algorithms

  • Linear search: checks each item in turn from the start. Works on unsorted or sorted lists. Worst case checks every item, so it is O(n).
  • Binary search: only works on a sorted list. Repeatedly checks the middle item and discards the half that cannot contain the target. Much faster on large lists (O(log n)) but the data must be sorted first.

Sorting algorithms

  • Bubble sort: repeatedly compares adjacent pairs and swaps them if out of order; the largest values 'bubble' to the end each pass. Simple but slow on large lists.
  • Insertion sort: builds a sorted section one item at a time, inserting each new item into its correct place.
  • Merge sort: splits the list into halves repeatedly until single items, then merges them back in order. Efficient on large lists (O(n log n)) but uses more memory.

Common mistakes

  • Confusing algorithm efficiency with correctness — an algorithm can be correct but still inefficient.
  • Forgetting binary search needs sorted data first.
  • Mixing up decomposition (breaking down) with abstraction (removing detail) — they are different skills.
  • In flowcharts, forgetting decision diamonds need two labelled paths.
  • Writing pseudocode that never terminates (missing a loop exit condition).
  • Trace tables: forgetting to update every variable on every pass, not just the one that changed.

Trace tables

Used to test/dry-run an algorithm by hand. Draw a column for each variable and a row for each iteration or step, updating values in order and noting any output.

Key facts

Flashcards

What are the three components of computational thinking?
Decomposition, abstraction, and algorithmic thinking.
tap to reveal
Define an algorithm.
A finite, unambiguous sequence of steps that solves a problem and always terminates.
tap to reveal
What is decomposition?
Breaking a large problem down into smaller, easier-to-solve sub-problems.
tap to reveal
What is abstraction?
Removing unnecessary detail so only the information relevant to solving the problem remains.
tap to reveal
Name the three basic programming constructs.
Sequence, selection, and iteration.
tap to reveal
What shape represents a decision in a flowchart, and how many exits does it have?
A diamond, with exactly two exits (usually labelled yes/no).
tap to reveal
How does linear search work?
It checks each item in a list one by one from the start until it finds the target or reaches the end.
tap to reveal
What condition must be true before you can use binary search?
The data 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 discards the half that cannot contain the target.
tap to reveal
How does bubble sort work?
It repeatedly compares adjacent pairs and swaps them if out of order, so the largest values move to the end each pass.
tap to reveal
How does insertion sort work?
It builds a sorted section of the list one item at a time, inserting each new item into its correct position.
tap to reveal
How does merge sort work?
It repeatedly splits the list in half until each part has one item, then merges the parts back together in order.
tap to reveal
Why is binary search faster than linear search on large sorted lists?
Because it halves the search space each step (O(log n)) instead of checking every item (O(n)).
tap to reveal
What is a trace table used for?
To dry-run an algorithm by hand, recording how each variable changes at every step or iteration.
tap to reveal
What are the three equivalent ways to represent an algorithm expected by OCR?
Flowcharts, pseudocode, and structured English.
tap to reveal
Practice questions

Algorithms & computational thinking: 5 practice questions

Q1. Which term describes breaking a large problem down into a series of smaller, more manageable sub-problems?
  • A.  Abstraction
  • B.  Pattern recognition
  • C.  Backtracking
  • D.  Decomposition
Show answer & explanation
✓ Answer: D. Decomposition
Decomposition is the process of splitting a complex problem into smaller sub-problems that are easier to solve individually. Abstraction is a different technique that involves removing unnecessary detail, not splitting the problem up.
Q2. Which term describes removing unnecessary detail from a problem so that only the information relevant to solving it remains?
  • A.  Iteration
  • B.  Decomposition
  • C.  Sequencing
  • D.  Abstraction
Show answer & explanation
✓ Answer: D. Abstraction
Abstraction means removing unnecessary detail so that only the information relevant to the problem remains, making it easier to focus on the essential elements of a solution. Decomposition is a different technique, concerned with splitting a problem into smaller sub-problems rather than removing detail.
Q3. A programmer notices that several different problems they have solved before share a similar structure. What is this recognition an example of?
  • A.  Algorithm design
  • B.  Pattern recognition
  • C.  Decomposition
  • D.  Abstraction
Show answer & explanation
✓ Answer: B. Pattern recognition
Pattern recognition is spotting similarities or common features between problems, which allows solutions from one problem to be reused or adapted for another. Decomposition instead concerns splitting a single problem into parts.
Q4. What is an algorithm?
  • A.  A precise, ordered set of steps to solve a problem
  • B.  A programming language used to write instructions
  • C.  A diagram showing how data flows through a system
  • D.  Any piece of computer program source code
Show answer & explanation
✓ Answer: A. A precise, ordered set of steps to solve a problem
An algorithm is a well-defined, step-by-step procedure or set of rules for solving a problem or completing a task. It is not tied to any specific programming language and is not the same as source code, which is one way of implementing an algorithm.
Q5. In a flowchart, which symbol shape is conventionally used to represent a decision (a point where the flow branches based on a condition)?
  • A.  Parallelogram
  • B.  Rhombus (diamond)
  • C.  Oval
  • D.  Rectangle
Show answer & explanation
✓ Answer: B. Rhombus (diamond)
A diamond (rhombus) shape represents a decision point, where the flow of the algorithm branches depending on whether a condition is true or false. Rectangles represent processes, ovals represent start/end points, and parallelograms represent input/output.
Test yourself
See the GCSE Computer Science (OCR) page

More GCSE Computer Science (OCR) topics