Algorithm design is a core part of Unit 1. You will be expected to define algorithms, interpret pseudocode, write your own algorithms, and understand common searching and sorting algorithms. This tutorial covers exactly what exam questions target.
An algorithm is a precise, step-by-step method for solving a problem. It must always:
Everything in computing is driven by algorithms: searching, sorting, routing, encryption, AI, graphics, simulation, scheduling and more.
Routing systems
- shortest path for internet packets
- airline crew scheduling
- delivery routing (e.g. Royal Mail, DPD)
Searching systems
- web search engines
- database queries
Security
- encryption and decryption
- authentication systems
Compilation
- translating high-level languages to machine code
Data processing
- sorting massive datasets
- filtering and analysing information
Every one of these relies on algorithmic thinking.
You must know these three tools:
Shows the overall problem broken into subtasks.
No details, just structure.
Perfect for decomposition.
Shows the flow of decisions, loops and processing.
Useful for visualising logic.
A language-agnostic way of writing algorithms clearly.
Should translate directly into code with minimal changes.
Pseudocode is the most heavily examined skill.
Your pseudocode must use:
- IF / ELSE / ELSEIF
- WHILE loops
- FOR loops
- meaningful variable names
- indentation
- clear logic
Example:
INPUT age
IF age >= 18 THEN
OUTPUT "Adult"
ELSE
OUTPUT "Minor"
ENDIF
Sorting is one of the most common operations in computing. Exams typically cover Bubble Sort and Insertion Sort.
Bubble sort repeatedly compares adjacent values and swaps them if they are in the wrong order.
Key behaviour:
- largest value “bubbles” to the end each pass
- extremely slow for large data
- only suitable for small lists
Pseudocode:
REPEAT
swapped = False
FOR i = 0 TO n - 2
IF list[i] > list[i+1] THEN
swap list[i] and list[i+1]
swapped = True
ENDIF
ENDFOR
n = n - 1
UNTIL swapped = False
Swap logic:
temp = list[i]
list[i] = list[i+1]
list[i+1] = temp
Insertion sort works like sorting playing cards in your hand.
Behaviour:
- take each item
- insert it into the correct place in the sorted section
- efficient for small lists
- poor for large datasets
Pseudocode:
FOR j = 1 TO n-1
nextValue = list[j]
i = j - 1
WHILE i >= 0 AND list[i] > nextValue
list[i+1] = list[i]
i = i - 1
ENDWHILE
list[i+1] = nextValue
ENDFOR
Exam skills required:
- trace through the algorithm
- identify number of passes
- state advantages/disadvantages
“n-1” passes for n values is a common exam fact.
You must understand Linear Search and Binary Search.
Checks each item in order until the target is found.
Used when:
- data is small
- data is unsorted
- searching happens infrequently
Pseudocode:
index = 0
found = False
WHILE found = False AND index < length
IF items[index] == target THEN
found = True
ELSE
index = index + 1
ENDIF
ENDWHILE
IF found THEN
OUTPUT index
ELSE
OUTPUT "Not found"
ENDIF
Only works on sorted lists.
Halves the search space each step.
Extremely fast.
Pseudocode:
found = False
low = 0
high = length - 1
WHILE low <= high AND found = False
mid = (low + high) DIV 2
IF list[mid] == target THEN
found = True
ELSEIF list[mid] > target THEN
high = mid - 1
ELSE
low = mid + 1
ENDIF
ENDWHILE
Binary search efficiency:
- Needs m comparisons where 2^m ≥ n
- For 1000 items, only 10 comparisons are needed
This is “divide and conquer”.
A good algorithm:
- has clear, precise steps
- handles invalid input
- always terminates
- runs efficiently
- is readable and maintainable
These criteria are common in long-answer questions.
This process will score high marks if written clearly.
Algorithm design is about creating efficient, logical solutions through:
- decomposition
- pseudocode
- flowcharts
- hierarchy charts
- searching and sorting algorithms
- precision and clarity
- performance considerations
Master these skills and you will comfortably handle all algorithm-based questions in Unit 1.
Create a customised learning path powered by AI — stay focused, track progress, and earn certificates.
Build Your Learning Path →