You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson provides comprehensive exam practice for the Algorithms topic, covering the key content from OCR J277 Section 2.2 that appears on Paper 2: Computational Thinking, Algorithms and Programming. This lesson brings together searching algorithms, sorting algorithms, trace tables, and algorithm design.
The OCR J277 Paper 2 exam is worth 80 marks and lasts 1 hour 30 minutes. The algorithms section typically accounts for approximately 15–25 marks. Questions range from 1-mark recall questions to 6-mark extended response questions.
Common question types include:
| Question Type | Typical Marks | What You Need to Do |
|---|---|---|
| Define/State | 1–2 marks | Give a precise definition (e.g. "What is an algorithm?") |
| Describe | 2–4 marks | Explain how an algorithm works step by step |
| Compare | 3–4 marks | Identify similarities and differences between algorithms |
| Trace table | 3–5 marks | Complete a trace table for given pseudocode |
| Write/Complete pseudocode | 3–6 marks | Write or complete an algorithm in pseudocode/Python |
| Evaluate/Recommend | 4–6 marks | Justify which algorithm is best for a given scenario |
Question: Define the term "algorithm" and give one reason why algorithms are used in program development.
Model Answer: An algorithm is a step-by-step set of instructions designed to solve a specific problem or complete a task (1 mark). Algorithms are used in program development to plan the solution before writing code, ensuring the logic is correct and allowing programmers to identify potential issues early (1 mark).
Question: The array data contains: [12, 5, 8, 3, 15, 7]. Trace the following algorithm when searching for the value 15.
target = 15
for i = 0 to data.length - 1
if data[i] == target then
print("Found at " + str(i))
endif
next i
Model Answer:
| i | data[i] | data[i] == 15? | Output |
|---|---|---|---|
| 0 | 12 | No | |
| 1 | 5 | No | |
| 2 | 8 | No | |
| 3 | 3 | No | |
| 4 | 15 | Yes | "Found at 4" |
| 5 | 7 | No |
Question: Describe how binary search would find the value 42 in the sorted list [10, 20, 30, 42, 50, 60, 70].
Model Answer:
(In this case the target happens to be the middle element. For a harder example where multiple steps are needed, always show low, high, mid at each step.)
Question: A company needs to sort a database of 100,000 customer records. Compare the suitability of bubble sort and merge sort for this task.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.