← Back to subjects
0
Edexcel GCSE Computer Science (1CP2) · Computational thinking
Mini-Lesson

Computational thinking

This mini-lesson covers the problem-solving skills Edexcel expects: decomposition, abstraction and algorithmic thinking, writing algorithms as flowcharts and pseudocode, the standard search and sort algorithms, trace tables, and comparing algorithm efficiency.

decomposition & abstraction algorithms: search & sort trace tables & efficiency thinking like a computer to solve problems

Work through each screen, answer the questions (some wordy, some tracing/counting) and collect ⭐ stars. Press Start when you're ready.

Thinking · decomposition & abstraction

Decomposition & abstraction

Two key ways of thinking about a problem:

  • Decomposition — breaking a large, complex problem down into smaller sub-problems that are each easier to solve. Each sub-problem can then become a subprogram (a function/procedure).
  • Abstractionremoving or hiding unnecessary detail so you can focus on the important parts. A map is an abstraction of a city: it keeps the roads but ignores the bricks.

Don't mix them up: decomposition = break it into parts; abstraction = ignore the irrelevant detail. You often do both together when designing a program.

Quick check

Which skill is this?

?A student designing a game ignores the exact colour of every pixel and just plans "player", "score" and "enemy". Which computational thinking skill is this?
Algorithms · flowcharts & pseudocode

Writing algorithms

An algorithm is a step-by-step sequence of instructions to solve a problem or complete a task. We write algorithms two main ways:

Start / Stop Process Decision Input / Output ⬭ terminator — start or stop ▭ process — a calculation/step ◇ decision — a yes/no question ▱ parallelogram — input or output
Flowchart symbols: terminator, process, decision, input/output — joined by arrows.

Pseudocode writes the same logic in structured English-like text, e.g.:

SEND "Enter a number" TO DISPLAY
RECEIVE num FROM KEYBOARD
IF num > 10 THEN
  SEND "big" TO DISPLAY
END IFEdexcel-style pseudocode uses SEND…TO DISPLAY, RECEIVE…FROM KEYBOARD, IF/END IF, WHILE/END WHILE.
Algorithms · searching

Searching: linear vs binary

  • Linear search — check each item one by one from the start until you find the target (or reach the end). Works on any list, even unsorted. Up to n checks for n items.
  • Binary search — the list must be sorted. Check the middle item; if the target is smaller, discard the top half, else discard the bottom half; repeat. About log₂(n) checks — far fewer for big lists.
1 3 5 7 9 11 13 ↑ middle checked first 7 items → binary: 1 → 3 → 5 checks max linear: up to 7 checks
Binary search halves the remaining items each step — but only works on a sorted list.

Key trade-off: binary search is much faster, but it requires a sorted list. If the data isn't sorted, you must use linear search (or sort it first).

Sort it

Which search does it describe?

Tap a statement, then tap the search it belongs to. (Some are true of both.)

🔁 Both searches

✂️ Binary only

➡️ Linear only

Quick check

When can't you use binary search?

?You need to find a name in a list that is in a random, unsorted order. Which is true?
Calculate

Your turn — binary search steps

1A sorted list has 16 items. In the worst case, how many items does a binary search check? (Each step halves the list: 16 → 8 → 4 → 2 → 1.)
checks
Hint: worst case = log₂(16). How many times do you halve 16 to reach 1?
Algorithms · sorting

Sorting: bubble & merge sort

  • Bubble sort — repeatedly go through the list comparing adjacent pairs and swapping them if they are in the wrong order. After each full pass the largest remaining value "bubbles" to the end. Simple but slow on large lists.
  • Merge sortdivide the list in half again and again until each part has one item, then merge the parts back together in order. Uses decomposition; much faster on large lists than bubble sort.
compare 5 and 2 → swap 5 2 8 1 2 5 8 1 bubble sort compares neighbours and swaps if out of order
Bubble sort: compare each adjacent pair and swap if the left is bigger; repeat passes until no swaps.

Compare: bubble sort is easy to code but slow (many comparisons); merge sort is more efficient for large data because it splits the work (decomposition).

Quick check

How does bubble sort work?

?Which statement best describes one pass of a bubble sort?
Algorithms · trace tables

Trace tables

A trace table lets you follow an algorithm by hand, writing down how each variable changes on every step. It's how you check an algorithm works — or find a bug.

Worked trace

total = 0

FOR i = 1 TO 3

  total = total + i

NEXT i

i = 1 → total = 0 + 1 = 1
i = 2 → total = 1 + 2 = 3
i = 3 → total = 3 + 3 = 6

Final total = 6

Tip: add a column for each variable and one row per loop pass. Never skip a pass — bugs hide in the step you didn't trace.

Trace it

Your turn — trace the loop

2Trace this: x = 10, then FOR i = 1 TO 4: x = x − 2. What is the final value of x?
Hint: the loop runs 4 times, each subtracting 2: 10 → 8 → 6 → 4 → 2.
Algorithms · efficiency

Comparing efficiency

Two correct algorithms can differ hugely in how much work they do. We compare efficiency mainly by the number of steps (and sometimes memory used) as the input size n grows.

  • Linear search: up to n checks. Binary search: about log₂(n) checks — grows far more slowly.
  • Bubble sort: comparisons grow roughly with — doubles the list, quadruples the work. Merge sort: grows roughly with n × log₂(n) — much better for big lists.

Why it matters: for a list of 1,000,000 items, linear search may need a million checks but binary search needs only about 20. Choosing the right algorithm saves time and energy.

Match it

Match the definition to the term

Tap a definition on the left, then its matching term on the right.

Definition
Term
Calculate

Your turn — linear search worst case

3A linear search runs on a list of 50 items and the target is not in the list. How many items must it check before it can be sure?
items
Hint: to be certain a value is absent, a linear search must check every single item.
Quick check

Which is more efficient?

?For searching a very large sorted list, which algorithm is more efficient and why?
Quick check

One more — decomposition

?A programmer splits a "quiz app" into separate parts: ask question, check answer, update score, show result. What is this an example of?
Recap

The big ideas to know

Decomposition: break a problem into smaller sub-problems

Abstraction: hide/ignore unnecessary detail

Algorithms: step-by-step; shown as flowcharts or pseudocode

Search: linear (any list, up to n) · binary (sorted only, ~log₂n)

Sort: bubble (swap adjacent, slow) · merge (divide & merge, faster)

Trace tables: track each variable per step · efficiency: compare number of steps as n grows

You've covered the whole of Edexcel Computational thinking. Press Finish to see your score.

🏆

Mini-lesson complete!

⭐⭐⭐

You've worked through Computational thinking for Edexcel GCSE Computer Science. 🎉

Your stars: 0 / 0

Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to all subjects