Designing, representing, tracing and evaluating algorithms using flowcharts, pseudocode and standard searching & sorting techniques.
🎯 Guiding Question: "How do we design step-by-step solutions that a computer can follow reliably?"
Arrow keys or buttons to navigate | F11 for full screen
An algorithm is a precise, step-by-step set of instructions designed to solve a problem or perform a task.
Has a definite start and end — it must terminate.
Every instruction is clear — no room for misinterpretation.
Produces the correct output for all valid inputs.
Everyday example: A recipe is an algorithm — ingredients (inputs), steps (process), dish (output). The steps must be followed in the correct order to get the right result.
In computing: Algorithms are used to search databases, sort data, compress files, navigate maps, recommend content, and much more. A good algorithm is correct, efficient, and clear.
Algorithms can be expressed in three main ways. You must be able to read and write all three.
A visual diagram using standard symbols (ovals, rectangles, diamonds) connected by arrows to show the flow of logic.
Best for: Visualising the logic — especially decisions and loops.
A structured, English-like notation that describes an algorithm without needing to follow any specific programming language syntax.
Edexcel uses: SET, RECEIVE, SEND, IF…END IF, FOR…END FOR, WHILE…END WHILE, etc.
A real programming language such as Python, which a computer can execute (after compilation or interpretation).
In this unit: We will show Edexcel pseudocode and equivalent Python side-by-side.
💡 Tip: In exams you may be asked to write in pseudocode or trace through a flowchart — both skills are assessed.
Decision labels: Always label the two exits of a diamond Yes (or True) and No (or False).
Task: Given three numbers A, B and C — find and output the largest.
Key exam point: Each diamond must have exactly two labelled exits. Never leave a branch unlabelled.
Try it: Trace through with A=7, B=12, C=5. Which path do you follow? What is the output?
Tracing = following the flow of an algorithm step-by-step with specific input values to determine the output.
| Step | Count | Count <= 3? | Output |
|---|---|---|---|
| Start | 1 | - | - |
| Check | 1 | Yes | 1 |
| Increment | 2 | Yes | 2 |
| Increment | 3 | Yes | 3 |
| Check | 4 | No | - |
| STOP | Loop ends | ||
How to trace: Work through each step in order. Record every variable change and any output. Never skip steps.
Exam tip: You will be given input values and asked to complete a trace table — or to find the bug by spotting where the trace goes wrong.
SET Counter TO 0 SET Name TO "Alice" SET Total TO Price * Quantity SET Arr[0] TO 42
RECEIVE Age FROM (INTEGER) KEYBOARD RECEIVE Name FROM (STRING) KEYBOARD SEND "Hello " & Name TO DISPLAY SEND Total TO DISPLAY
IF Score >= 70 THEN
SEND "Pass" TO DISPLAY
ELSE
SEND "Fail" TO DISPLAY
END IF
# Count-controlled
FOR i FROM 1 TO 5 DO
SEND i TO DISPLAY
END FOR
# Pre-condition
WHILE Count > 0 DO
SET Count TO Count - 1
END WHILE
# Post-condition
REPEAT
RECEIVE n FROM (INTEGER) KEYBOARD
UNTIL n > 0
| Symbol | Meaning |
|---|---|
| + - * / | Arithmetic |
| MOD | Remainder (e.g. 7 MOD 3 = 1) |
| DIV | Integer division (e.g. 7 DIV 3 = 2) |
| = <> < > <= >= | Comparisons |
| AND OR NOT | Logical |
| & | String concatenation |
Sequence = instructions executed one after another, in order, with no branching or repetition. It is the simplest control structure.
# Area of a Rectangle RECEIVE Length FROM (REAL) KEYBOARD RECEIVE Width FROM (REAL) KEYBOARD SET Area TO Length * Width SEND "Area = " & Area TO DISPLAY
# Area of a Rectangle
length = float(input("Enter length: "))
width = float(input("Enter width: "))
area = length * width
print("Area =", area)
Step 1: Input — receive values from the user.
Step 2: Process — calculate Area = Length × Width.
Step 3: Output — display the result to the screen.
💡 IPO model: Almost every algorithm follows Input → Process → Output. Sequence is the backbone of all programs.
Selection allows an algorithm to make decisions — different instructions are executed depending on whether a condition is true or false.
# Grade classifier
RECEIVE Score FROM (INTEGER) KEYBOARD
IF Score >= 70 THEN
SEND "Grade: A" TO DISPLAY
ELSE
IF Score >= 55 THEN
SEND "Grade: B" TO DISPLAY
ELSE
IF Score >= 40 THEN
SEND "Grade: C" TO DISPLAY
ELSE
SEND "Grade: U" TO DISPLAY
END IF
END IF
END IF
# Grade classifier
score = int(input("Enter score: "))
if score >= 70:
print("Grade: A")
elif score >= 55:
print("Grade: B")
elif score >= 40:
print("Grade: C")
else:
print("Grade: U")
Edexcel note: There is no ELIF keyword — nested IF...END IF blocks are used instead. Each IF must be closed with END IF.
Trace check: With Score = 62, which branch executes? Answer: Score < 70 → Score >= 55 → "Grade: B".
Iteration (looping) lets a set of instructions execute repeatedly. Edexcel pseudocode has three loop structures — you must know when to use each one.
COUNT-CONTROLLED LOOP — use when you know exactly how many times to repeat
# Print 1 to 5
FOR i FROM 1 TO 5 DO
SEND i TO DISPLAY
END FOR
# With a step
FOR i FROM 0 TO 20 STEP 5 DO
SEND i TO DISPLAY
END FOR
# Print 1 to 5
for i in range(1, 6):
print(i)
# With a step
for i in range(0, 21, 5):
print(i)
PRE-CONDITION — check first, may never run
# Keep asking until valid
RECEIVE n FROM (INTEGER) KEYBOARD
WHILE n <= 0 DO
SEND "Enter positive number"
TO DISPLAY
RECEIVE n FROM (INTEGER)
KEYBOARD
END WHILE
n = int(input())
while n <= 0:
print("Enter positive number")
n = int(input())
POST-CONDITION — runs at least once
# Always runs body first
REPEAT
SEND "Enter positive number"
TO DISPLAY
RECEIVE n FROM (INTEGER)
KEYBOARD
UNTIL n > 0
💡 Python has no REPEAT-UNTIL equivalent. Python only has while (pre-condition). The common workaround is while True: ... if cond: break — but this is not a built-in loop type.
💡 Exam tip: REPEAT…UNTIL always executes at least once. WHILE may execute zero times if the condition is false from the start. Know which to choose!
Both loops below print the numbers 1, 2, 3. Notice where the condition diamond appears — that is the key structural difference.
WHILE Loop — condition checked FIRST
May execute zero times if condition is false at the start
Pseudocode: WHILE Count ≤ 3 DO … END WHILE
REPEAT-UNTIL — condition checked LAST
Always executes at least once
Pseudocode: REPEAT … UNTIL Count > 3
⚠ Key difference: If Count started at 4, the WHILE loop body would never run. The REPEAT-UNTIL body would run once, output 4, then exit. Same condition — completely different behaviour!
In the exam you will be given an algorithm and asked "What does this algorithm do?" — you need a strategy to work it out quickly.
SET Total TO 0
SET Count TO 0
RECEIVE n FROM (INTEGER) KEYBOARD
WHILE n <> -1 DO
SET Total TO Total + n
SET Count TO Count + 1
RECEIVE n FROM (INTEGER) KEYBOARD
END WHILE
IF Count > 0 THEN
SEND Total / Count TO DISPLAY
END IF
| n (input) | Total | Count | n ≠ -1? | Output |
|---|---|---|---|---|
| 8 | 8 | 1 | Yes | — |
| 4 | 12 | 2 | Yes | — |
| 6 | 18 | 3 | Yes | — |
| -1 | 18 | 3 | No → exit | 18/3 = 6 |
Purpose: This algorithm reads a series of integers (terminated by -1) and outputs their arithmetic mean (average). The sentinel value -1 signals the end of input.
A trace table is a method of manually tracking the values of variables and outputs as you execute an algorithm step by step. It is used to verify correctness or locate errors.
SET Total TO 0
FOR i FROM 1 TO 3 DO
RECEIVE num FROM (INTEGER) KEYBOARD
SET Total TO Total + num
END FOR
SEND Total TO DISPLAY
| i | num | Total | Output |
|---|---|---|---|
| — | — | 0 | — |
| 1 | 3 | 3 | — |
| 2 | 7 | 10 | — |
| 3 | 2 | 12 | — |
| — | — | — | 12 |
Output = 12 ✓ (3 + 7 + 2 = 12)
Trace tables are a powerful tool for locating bugs. When the trace produces an unexpected output, you can pinpoint exactly which line caused the error.
Task: read 3 numbers and output their sum.
SET Total TO 1 # Line 1 ← BUG HERE FOR i FROM 1 TO 3 DO RECEIVE num FROM (INTEGER) KEYBOARD SET Total TO Total + num END FOR SEND Total TO DISPLAY
⚠ Line 1: Total is initialised to 1 instead of 0. Every result will be 1 too large.
| Step | i | num | Total | Output |
|---|---|---|---|---|
| Initialise | — | — | 1 ⚠ | — |
| i = 1 | 1 | 4 | 5 | — |
| i = 2 | 2 | 5 | 10 | — |
| i = 3 | 3 | 6 | 16 | — |
| Output | — | — | — | 16 ⚠ |
Expected: 4 + 5 + 6 = 15
Actual output: 16 — off by 1
Fix: Change SET Total TO 1 → SET Total TO 0
✘ Buggy:
SET Arr TO [3,7,2,9,5]
SET Max TO 0
FOR i FROM 0 TO 3 DO
IF Arr[i] > Max THEN
SET Max TO Arr[i]
END IF
END FOR
SEND Max TO DISPLAY
Misses index 4 (value 5). Should be TO 4.
✔ Fixed:
SET Arr TO [3,7,2,9,5]
SET Max TO 0
FOR i FROM 0 TO 4 DO
IF Arr[i] > Max THEN
SET Max TO Arr[i]
END IF
END FOR
SEND Max TO DISPLAY
Now checks all 5 elements. Output: 9.
Errors in programs fall into three categories. Understanding which type you have tells you how to find and fix it — and trace tables are especially useful for logic errors.
The code breaks the rules of the language. The interpreter/compiler catches it before the program runs.
✘ Buggy pseudocode:
IF Score > 70 # missing THEN
SEND "Pass" TO DISPLAY
END IF
✔ Fixed:
IF Score > 70 THEN
SEND "Pass" TO DISPLAY
END IF
Other examples: misspelled keywords, missing END FOR, unmatched brackets.
The program starts running but crashes at some point due to an impossible operation.
✘ Example:
RECEIVE count FROM (INTEGER) KEYBOARD
SET result TO 10 / count
# If user enters 0 → crash!
✔ Fixed with guard:
IF count <> 0 THEN
SET result TO 10 / count
END IF
Other examples: array index out of bounds, reading a file that doesn't exist.
The program runs without crashing but produces the wrong output. The hardest type to find — use a trace table!
✘ Example:
IF age > 18 THEN # excludes age=18!
SEND "Adult" TO DISPLAY
END IF
✔ Fixed:
IF age >= 18 THEN
SEND "Adult" TO DISPLAY
END IF
Other examples: wrong formula, loop runs one time too many/few.
| Error Type | When detected? | Program runs? | How to find it? |
|---|---|---|---|
| Syntax | Before running (compile/parse time) | No | Read the error message from the interpreter |
| Runtime | During execution | Partially | Check what inputs cause the crash; add guards |
| Logic | Never caught automatically | Yes (wrongly) | Trace table, test data, desk-checking |
A linear search checks each element of a list one by one, from the first to the last, until the target is found or the list is exhausted. It works on any list — sorted or unsorted.
# Linear Search
# Find target in array Arr of size N
SET Found TO FALSE
SET Index TO 0
WHILE Index < N AND Found = FALSE DO
IF Arr[Index] = Target THEN
SET Found TO TRUE
ELSE
SET Index TO Index + 1
END IF
END WHILE
IF Found = TRUE THEN
SEND "Found at index " & Index TO DISPLAY
ELSE
SEND "Not found" TO DISPLAY
END IF
arr = [14, 3, 27, 9, 42, 7]
target = 9
found = False
index = 0
while index < len(arr) and not found:
if arr[index] == target:
found = True
else:
index += 1
if found:
print("Found at index", index)
else:
print("Not found")
| Index | Arr[Index] | = Target (9)? | Found | Action |
|---|---|---|---|---|
| 0 | 14 | No | FALSE | Index → 1 |
| 1 | 3 | No | FALSE | Index → 2 |
| 2 | 27 | No | FALSE | Index → 3 |
| 3 | 9 | Yes ✓ | TRUE | Output "Found at index 3" |
Advantages: Simple to code; works on unsorted data; no pre-processing needed.
Disadvantages: Slow for large lists — worst case checks every element. Time grows linearly with list size (O(n)).
A binary search repeatedly halves the search space by comparing the target to the middle element. It is much faster than linear search — but the list must be sorted first.
# Binary Search (sorted array)
SET Low TO 0
SET High TO N - 1
SET Found TO FALSE
WHILE Low <= High AND Found = FALSE DO
SET Mid TO (Low + High) DIV 2
IF Arr[Mid] = Target THEN
SET Found TO TRUE
ELSE
IF Target < Arr[Mid] THEN
SET High TO Mid - 1
ELSE
SET Low TO Mid + 1
END IF
END IF
END WHILE
IF Found = TRUE THEN
SEND "Found at index " & Mid TO DISPLAY
ELSE
SEND "Not found" TO DISPLAY
END IF
# List MUST be sorted
arr = [3, 7, 9, 14, 27, 42]
target = 9
low = 0
high = len(arr) - 1
found = False
while low <= high and not found:
mid = (low + high) // 2
if arr[mid] == target:
found = True # found
elif target < arr[mid]:
high = mid - 1 # search left half
else:
low = mid + 1 # search right half
if found:
print("Found at index", mid)
else:
print("Not found")
| Step | Low | High | Mid | Arr[Mid] | Compare to 9 | Action |
|---|---|---|---|---|---|---|
| 1 | 0 | 5 | 2 | 9 | = Target ✓ | Found at index 2 |
Found in just 1 step! Compare: linear search would have taken 3 steps.
Example where more steps are needed — search for 27:
| Step | Low | High | Mid | Arr[Mid] | Compare to 27 | Action |
|---|---|---|---|---|---|---|
| 1 | 0 | 5 | 2 | 9 | 27 > 9 | Low = 3 |
| 2 | 3 | 5 | 4 | 27 | = Target ✓ | Found at index 4 |
Advantages: Very fast — halves the search space each step. Max steps = log₂(n). For 1 million items: only ~20 comparisons.
Disadvantages: List must be sorted before searching. Sorting takes extra time. More complex to code than linear search.
Bubble sort repeatedly steps through the list, compares adjacent pairs, and swaps them if they are in the wrong order. Larger values "bubble up" to the end with each pass.
# Bubble Sort (ascending order)
SET N TO LENGTH(Arr)
SET Swapped TO TRUE
WHILE Swapped = TRUE DO
SET Swapped TO FALSE
FOR i FROM 0 TO N - 2 DO
IF Arr[i] > Arr[i + 1] THEN
# Swap adjacent elements
SET Temp TO Arr[i]
SET Arr[i] TO Arr[i + 1]
SET Arr[i + 1] TO Temp
SET Swapped TO TRUE
END IF
END FOR
SET N TO N - 1 # last item now in place
END WHILE
arr = [5, 3, 8, 1, 9, 2]
n = len(arr)
swapped = True
while swapped:
swapped = False
for i in range(n - 1):
if arr[i] > arr[i + 1]:
# Swap adjacent elements
temp = arr[i]
arr[i] = arr[i + 1]
arr[i + 1] = temp
swapped = True
n -= 1 # last element now in place
print(arr) # → [1, 2, 3, 5, 8, 9]
| Pass | Array after pass | Swaps made? | Sorted position |
|---|---|---|---|
| Start | [5, 3, 8, 1, 9, 2] | — | — |
| Pass 1 | [3, 5, 1, 8, 2, 9] | Yes | Index 5 → 9 fixed |
| Pass 2 | [3, 1, 5, 2, 8, 9] | Yes | Index 4 → 8 fixed |
| Pass 3 | [1, 3, 2, 5, 8, 9] | Yes | Index 3 → 5 fixed |
| Pass 4 | [1, 2, 3, 5, 8, 9] | Yes | Index 2 → 3 fixed |
| Pass 5 | [1, 2, 3, 5, 8, 9] | No swaps | Fully sorted — stop early |
💡 The Swapped flag is an optimisation — if no swaps occur in a pass, the list is already sorted and the algorithm stops early instead of making unnecessary passes.
Advantages: Simple to understand and code; detects already-sorted lists quickly (with Swapped flag); works in-place (no extra memory needed).
Disadvantages: Slow on large lists — worst case O(n²) comparisons. Not suitable for large datasets. Merge sort is significantly more efficient.
Merge sort uses a divide and conquer strategy: repeatedly split the list in half until each piece has one element, then merge the pieces back together in sorted order.
# Merge two sorted lists A and B into C
SET i TO 0
SET j TO 0
SET C TO []
WHILE i < LENGTH(A) AND j < LENGTH(B) DO
IF A[i] <= B[j] THEN
SET C TO C & A[i]
SET i TO i + 1
ELSE
SET C TO C & B[j]
SET j TO j + 1
END IF
END WHILE
# Append any remaining elements
WHILE i < LENGTH(A) DO
SET C TO C & A[i]
SET i TO i + 1
END WHILE
WHILE j < LENGTH(B) DO
SET C TO C & B[j]
SET j TO j + 1
END WHILE
A = [27, 38, 43] # sorted left half
B = [3, 9, 82] # sorted right half
C = []
i = 0
j = 0
while i < len(A) and j < len(B):
if A[i] <= B[j]:
C.append(A[i])
i += 1
else:
C.append(B[j])
j += 1
# Append leftover elements
while i < len(A):
C.append(A[i])
i += 1
while j < len(B):
C.append(B[j])
j += 1
print(C) # → [3, 9, 27, 38, 43, 82]
Advantages: Much faster than bubble sort for large lists — O(n log n). Consistent performance regardless of initial order.
Disadvantages: More complex to code. Requires extra memory to hold the temporary sublists during merging.
The choice of algorithm depends on the data: its size, whether it is sorted, and how often the search or sort needs to run. There is no single "best" algorithm for all situations.
| Factor | Linear Search | Binary Search |
|---|---|---|
| Data must be sorted? | No — works on any list | Yes — list must be sorted first |
| Speed (small list) | Similar — difference negligible | Similar — overhead not worth it |
| Speed (large list) | Slow — checks every item (O(n)) | Fast — halves search space (O(log n)) |
| Worst case (1000 items) | Up to 1000 comparisons | Up to 10 comparisons |
| Best for | Small or unsorted datasets; one-off searches | Large sorted datasets; repeated searches |
| Factor | Bubble Sort | Merge Sort |
|---|---|---|
| Complexity | Simple to understand and code | More complex — divide & conquer |
| Speed (small list) | Fine — simple and fast enough | Slight overhead from splitting |
| Speed (large list) | Very slow — O(n²) comparisons | Much faster — O(n log n) |
| Memory use | In-place — no extra memory | Needs extra memory for sublists |
| Best for | Small lists; teaching; nearly-sorted data | Large datasets where speed matters |
💡 Exam tip: When asked to justify a choice of algorithm, always link to the data characteristics — size, whether it is sorted, and how often the operation runs. "Binary search is better because the list is large and already sorted" scores marks. "Binary search is faster" alone does not.
An algorithm is fit for purpose if it produces the correct output for all valid inputs, handles edge cases correctly, and performs efficiently enough for its intended use.
| Type | Description | Example (age 0–120) |
|---|---|---|
| Normal | Typical valid input | 25, 40, 67 |
| Boundary | Values at the edge of the valid range | 0, 1, 119, 120 |
| Erroneous | Invalid input that should be rejected | -1, 121, "abc" |
RECEIVE Score FROM (INTEGER) KEYBOARD
IF Score >= 70 THEN
SEND "A" TO DISPLAY
ELSE
IF Score >= 55 THEN
SEND "B" TO DISPLAY
ELSE
IF Score >= 40 THEN
SEND "C" TO DISPLAY
ELSE
SEND "U" TO DISPLAY
END IF
END IF
END IF
| Test type | Input | Expected | Pass? |
|---|---|---|---|
| Normal | 75 | A | ✓ |
| Normal | 50 | C | ✓ |
| Boundary | 70 | A | ✓ |
| Boundary | 40 | C | ✓ |
| Boundary | 39 | U | ✓ |
| Erroneous | -5 | Rejected | ✗ — outputs U! |
Not fully fit for purpose — erroneous input (-5) is not validated. A guard clause checking 0 <= Score <= 100 is needed.
State what is meant by an algorithm and give one characteristic it must have.
[2 marks]The algorithm below is intended to find the largest of three numbers A, B and C. Trace through it with A = 4, B = 9, C = 6 and complete the trace table.
[3 marks]IF A > B THEN
IF A > C THEN
SET Largest TO A
ELSE
SET Largest TO C
END IF
ELSE
IF B > C THEN
SET Largest TO B
ELSE
SET Largest TO C
END IF
END IF
SEND Largest TO DISPLAY
| A | B | C | A > B? | B > C? | Largest | Output |
|---|---|---|---|---|---|---|
| 4 | 9 | 6 |
Identify the type of error in the following pseudocode and describe how to fix it.
[3 marks]SET Total TO 0
FOR i FROM 1 TO 5 DO
RECEIVE num FROM (INTEGER) KEYBOARD
SET Total TO Total - num
END FOR
SEND Total TO DISPLAY
Hint: what should happen to Total when a number is received?
A list contains 512 items. Compare the maximum number of comparisons needed to find an item using (a) linear search and (b) binary search. The list is already sorted.
[4 marks]The array below is to be sorted into ascending order using bubble sort.
Show the array after each complete pass until no more swaps are needed.
Starting array: [7, 2, 5, 1, 8]
| Pass | Array after pass | Swaps made? |
|---|---|---|
| Start | [7, 2, 5, 1, 8] | — |
| 1 | ||
| 2 | ||
| 3 | ||
| 4 |
Write pseudocode for a linear search that searches for a value entered by the user in an array called Items of size 8. Output the index if found, or "Not found" otherwise.
A programmer tests a grade-checking program with the inputs below. Identify the type of test data for each and explain why each is used.
[6 marks]| Input value | Type of test data | Reason for using it |
|---|---|---|
| 65 | ||
| 0 | ||
| -10 |
An algorithm is a precise, step-by-step set of instructions for solving a problem or completing a task. [1 mark]
One characteristic (any one of): it must be finite (terminates); unambiguous (every step is clear); effective (produces the correct result for all valid inputs). [1 mark]
Trace with A=4, B=9, C=6:
| A | B | C | A > B? | B > C? | Largest | Output |
|---|---|---|---|---|---|---|
| 4 | 9 | 6 | No | Yes | 9 | 9 |
A > B is False → go to ELSE branch → B > C is True → Largest = B = 9 ✓
Error type: Logic error — the program runs without crashing but gives the wrong output. [1 mark]
Problem: Line 4 uses Total TO Total - num (subtracts) instead of adding. [1 mark]
Fix: Change to SET Total TO Total + num [1 mark]
(a) Linear search: Maximum 512 comparisons — must check every item in the worst case. [1 mark]
(b) Binary search: Maximum 9 comparisons — log₂(512) = 9. Each comparison halves the remaining search space. [1 mark]
Conclusion: Binary search is significantly faster for a sorted list of this size — 9 comparisons vs up to 512. [1 mark]
Requirement: Binary search requires the list to be sorted first; linear search does not. [1 mark]
Bubble sort passes on [7, 2, 5, 1, 8]:
| Pass | Array after pass | Swaps? |
|---|---|---|
| Start | [7, 2, 5, 1, 8] | — |
| 1 | [2, 5, 1, 7, 8] | Yes |
| 2 | [2, 1, 5, 7, 8] | Yes |
| 3 | [1, 2, 5, 7, 8] | Yes |
| 4 | [1, 2, 5, 7, 8] | No → stop |
Gold values indicate elements confirmed in their final sorted position after each pass.
Linear search pseudocode:
RECEIVE Target FROM (INTEGER) KEYBOARD
SET Found TO FALSE
SET Index TO 0
WHILE Index < 8 AND Found = FALSE DO
IF Items[Index] = Target THEN
SET Found TO TRUE
ELSE
SET Index TO Index + 1
END IF
END WHILE
IF Found = TRUE THEN
SEND Index TO DISPLAY
ELSE
SEND "Not found" TO DISPLAY
END IF
Award 1 mark each for: correct initialisation; WHILE condition with both checks; IF comparison inside loop; incrementing index; correct output both branches.
| Input | Type | Reason |
|---|---|---|
| 65 | Normal | Typical valid input — checks the algorithm works correctly for expected values [1 mark] |
| 0 | Boundary | At the lower edge of the valid range — checks the algorithm handles the minimum value correctly [1 mark] |
| -10 | Erroneous | Invalid input outside the accepted range — checks the algorithm rejects or handles invalid data without crashing [1 mark] |