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