0% found this document useful (0 votes)
4 views36 pages

Ms Method

The document outlines the mark scheme method for OCR H446/02 Paper 2, focusing on algorithms and programming written theory. It includes a compilation of exam-style questions and answers from various years, emphasizing key concepts and creditworthy ideas for exam preparation. The content deliberately excludes practical coding tasks and calculations, concentrating instead on theoretical understanding and explanations.

Uploaded by

lxbudarin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views36 pages

Ms Method

The document outlines the mark scheme method for OCR H446/02 Paper 2, focusing on algorithms and programming written theory. It includes a compilation of exam-style questions and answers from various years, emphasizing key concepts and creditworthy ideas for exam preparation. The content deliberately excludes practical coding tasks and calculations, concentrating instead on theoretical understanding and explanations.

Uploaded by

lxbudarin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Mark Scheme Method


OCR H446/02 Paper 2 Written Q&A;
Algorithms and programming - written theory only
Compiled from uploaded OCR H446/02 question papers and mark schemes: 2017,
2018, 2019, 2020, 2021, 2022, 2023, 2024 and 2025.

Only Component 2 / Paper 2. No Paper 1 content. No code-writing tasks. No trace


tables. No calculations.

Page 1
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

How to use this PDF


Each answer is written as compact exam-style mark points. The [1] markers show the separate creditworthy
ideas that can earn marks.
Practise by covering the answer, writing a response from memory, then checking whether each [1] point is
present.
For 6-12 mark evaluation questions, learn the answer plan rather than memorising a full essay. OCR rewards
accurate theory, application and a justified judgement.
This booklet includes only H446/02 Algorithms and programming written-theory questions. It deliberately
excludes code completion, class/constructor code, trace tables, practical sorting/searching walkthroughs,
calculations and table-completion tasks.

Coverage
2017 - H446/02 Paper 2, 2018 - H446/02 Paper 2, 2019 - H446/02 Paper 2, 2020 - H446/02 Paper 2, 2021 -
H446/02 Paper 2, 2022 - H446/02 Paper 2, 2023 - H446/02 Paper 2, 2024 - H446/02 Paper 2, 2025 - H446/02
Paper 2

Page 2
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Year-by-year written Q&A;


2017 - H446/02 Paper 2
Question:
Using Big-O notation, state and explain the best-case time complexity of insertion sort.

Answer:
The best-case time complexity is O(n). [1] This occurs when the list is already sorted. [1] As the number of items
increases, the number of comparisons or steps increases linearly. [1] Doubling the number of items would roughly
double the work rather than square it. [1]

Question:
Outline how bubble sort works and explain how its complexity compares with insertion sort.

Answer:
Bubble sort compares adjacent items. [1] If two adjacent items are out of order, they are swapped. [1] It repeats
passes through the list until a full pass makes no swaps. [1] O(n^2) time means the running time grows
quadratically as the data size increases. [1] O(1) space means the amount of extra memory stays constant
regardless of the number of items. [1] Both bubble sort and insertion sort are in-place, so both can have O(1)
space complexity. [1] The same Big-O complexity does not mean the algorithms take exactly the same time. [1]
Insertion sort is usually faster than bubble sort, although neither scales well for very large data sets. [1]

Question:
Explain why a linked list can be suitable for an ordering system.

Answer:
Orders can be processed in the order required by the list. [1] New orders can be inserted at any position, such as
placing a high-priority order earlier. [1] Completed orders can be removed from any position in the list. [1] The list
is dynamic, so orders can be added or deleted as needed. [1]

Question:
Justify the choice of a linear search rather than a binary search for an unordered linked list.

Answer:
The appropriate algorithm is linear search. [1] Linear search does not require the items to be stored in a particular
order. [1] Binary search would not be suitable unless the items were ordered. [1]

Question:
Identify features of an IDE and describe how each benefits the programmer.

Answer:
Auto-complete suggests identifiers and reduces spelling errors. [1] Syntax highlighting colour-codes code so
structures and possible syntax errors are easier to spot. [1] Step mode runs one statement at a time so the
programmer can check the effect of each statement. [1] Breakpoints stop the program at chosen lines so variable
values can be inspected. [1] A watch window shows how variables change while the program runs. [1] Error
diagnostics locate errors and give details to help correction. [1]

Page 3
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Discuss how concurrent programming could be applied to an order-processing system.

Answer:
Concurrent programming allows processes or threads to overlap in time. [1] On a single-core processor it
simulates simultaneous processing by switching between threads. [1] Several tasks may be entered or updated at
overlapping times. [1] Shared data may be accessed by more than one thread. [1] Locking or mutual exclusion is
needed to stop two threads corrupting the same data. [1] This makes the program more complex to write and
debug. [1] Concurrency can model real systems where independent activities occur at the same time. [1] Not all
parts can be parallelised, so extra processors do not produce a proportional speed-up. [1]

Question:
Describe advantages of splitting a program into sub-procedures.

Answer:
Sub-procedures can be reused, so code does not need to be rewritten. [1] Different programmers can work on
different procedures. [1] This can speed up development because work can happen concurrently. [1] Each
procedure can be tested separately, making debugging easier. [1]

Question:
Explain the difference between depth-first traversal and breadth-first traversal.

Answer:
Depth-first traversal follows a branch as far as possible before moving to another branch. [1] In post-order
traversal, a node is visited after its child nodes have been processed. [1] When no further child node can be
followed, the traversal backtracks to a previous node. [1] Breadth-first traversal visits all nodes at the current level
or distance before moving to the next level. [1] Depth-first traversal can use a stack, while breadth-first traversal
uses a queue. [1]

Question:
Explain how backtracking is used in a depth-first traversal.

Answer:
When a node has no unvisited child nodes, the algorithm returns to the previous node. [1] It then checks whether
that previous node has another branch to visit. [1] This repeats until a new unvisited node is found or all reachable
nodes have been visited. [1]

Question:
Describe the process of decomposition.

Answer:
Decomposition is splitting a problem into smaller component parts or sub-problems. [1] Each part can then be
considered, designed, implemented or tested separately. [1]

Page 4
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Discuss the need for and purpose of abstraction in a program such as a virtual pet game.

Answer:
Abstraction removes unnecessary details from the real-world problem. [1] It keeps only the features needed for
the program's purpose. [1] Symbols or simplified values can represent real-world details. [1] Irrelevant details can
be omitted. [1] This reduces programming complexity. [1] It can reduce processing and memory requirements. [1]
It helps the developer focus on the core functionality. [1] Too much abstraction may make the model unrealistic or
less useful. [1]

Page 5
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2018 - H446/02 Paper 2


Question:
State what is meant by problem recognition and decomposition, and give another computational method.

Answer:
Problem recognition is identifying that there is a problem to solve, or identifying what the problem is. [1]
Decomposition is splitting the problem into smaller sub-problems. [1] Other computational methods include
abstraction, divide and conquer, modelling, heuristics, visualisation, backtracking and concurrency. [1]

Question:
Define data mining and describe how a business could use it.

Answer:
Data mining is finding patterns or useful information in large quantities of data. [1] It can identify customer trends.
[1] The business can use those trends to choose products or offers for customers. [1] It can identify poor-selling
items. [1] The business can replace poor-selling items or change its promotion strategy. [1]

Question:
Define performance modelling and describe one way it can be used.

Answer:
Performance modelling is simulating or testing the behaviour of a system before it is used. [1] It can be used to
test the system with many simultaneous users, orders or data items. [1] This helps identify performance issues
before installation. [1]

Question:
Describe one benefit of creating reusable program components.

Answer:
Reusable components can be used again in future programs. [1] They do not need to be rewritten, saving
development time. [1] If they have already been tested, they can reduce later testing and debugging effort. [1]

Question:
Identify differences between a graph and a tree.

Answer:
A graph may contain cycles, while a tree does not. [1] A tree normally has a hierarchy with a root and parent-child
relationships. [1] A graph may be directed or undirected and may also be weighted. [1]

Question:
Explain how a graph can be an abstraction of a problem.

Answer:
The graph removes the full details of the real problem and represents only the relevant states or stages. [1]
Nodes can represent possible states or sub-problems. [1] Edges can represent possible routes or transitions
between those states. [1]

Page 6
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Identify advantages of using a visualisation to represent a problem.

Answer:
A visualisation presents information in a simpler form for humans to understand. [1] It can make complex
relationships easier to see. [1] It can help plan or explain a solution before implementing an algorithm. [1]

Question:
Compare Dijkstra's algorithm and the A* search algorithm when finding a shortest path.

Answer:
Dijkstra's algorithm uses known edge weights or distances from the start node. [1] A* also uses a heuristic
estimate of the distance to the goal. [1] A useful heuristic can guide A* toward promising paths faster. [1] A* may
need fewer comparisons because it does not have to explore as many alternatives. [1] Dijkstra will find the
shortest path without needing a heuristic. [1] A* depends on the quality of the heuristic, so a poor heuristic
reduces its advantage. [1] A* can be preferable when the graph is large and a reliable heuristic is available. [1]

Question:
Explain why a parameter may be passed by value rather than by reference in a recursive function.

Answer:
Passing by value sends a copy of the value into the sub-program. [1] The original variable is not overwritten by
changes inside the sub-program. [1] Passing by reference gives access to the original variable's memory location.
[1] In recursive functions, passing by reference could cause values from earlier calls to be overwritten and
produce incorrect results. [1]

Question:
Compare the use of parameters and global variables in recursive functions.

Answer:
Parameters allow values to be passed into a sub-program. [1] A parameter becomes local to that call of the
function. [1] Global variables can be accessed throughout the program. [1] Using global variables in recursion
risks each call overwriting values needed by other calls. [1] Parameters make recursive calls independent
because each call has its own local values. [1] Global variables occupy memory for the whole runtime of the
program. [1] Parameters or local variables can be released when the call finishes. [1]

Question:
Explain why a recursive algorithm may use more memory than an iterative algorithm.

Answer:
Each recursive call stores its current state on the call stack. [1] This may include parameters, local variables and
the return address. [1] Iteration normally reuses the same variables each time the loop repeats. [1]

Question:
Describe the decisions needed before pushing to or popping from a stack.

Answer:
Before push, the program checks whether the stack is full. [1] If it is not full, the new item can be inserted. [1] If it
is full, an error should be reported or the push should be rejected. [1] Before pop, the program checks whether the
stack is empty. [1] If it is not empty, the top item can be returned or removed. [1] If it is empty, an error should be
reported or the pop should be rejected. [1]

Page 7
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe how a 1D array can be used to implement a stack.

Answer:
The array size is defined. [1] A stack pointer stores the position of the top item. [1] When an item is pushed, it is
stored at the top position and the pointer is updated. [1] When an item is popped, the top item is returned or
removed and the pointer is updated in the opposite direction. [1]

Question:
Describe the stages of a binary search on a sorted array.

Answer:
Set lower and upper bounds for the search range. [1] Calculate the midpoint from the bounds. [1] Compare the
middle item with the target value. [1] If the middle item equals the target, return the position or set found to true.
[1] If the middle item is less than the target, move the lower bound above the midpoint. [1] If the middle item is
greater than the target, move the upper bound below the midpoint. [1] Repeat until the item is found or the bounds
cross. [1]

Question:
Explain similarities and differences between a record and a class.

Answer:
A record is a data structure that stores related fields. [1] A class is a template for creating objects. [1] Both can
store data of different types, accessed using field or attribute names. [1] A class can also include methods that
define behaviour. [1] A class can use visibility such as private attributes, whereas a record usually just groups
data. [1]

Question:
Define the term queue.

Answer:
A queue is a data structure. [1] It is first in, first out, so the first item added is the first item removed. [1]

Question:
Explain how private attributes improve data integrity.

Answer:
Private attributes are encapsulated and can only be accessed through methods. [1] The methods can validate
data before changing the attribute. [1] This reduces accidental or inappropriate changes to the data. [1]

Question:
Describe how a program can make sure data still exists the next time it is run.

Answer:
Save the data to an external file when the program closes. [1] Load the saved data from the file when the program
starts again. [1]

Page 8
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Evaluate the use of caching and concurrent processing for a very large searchable data set.

Answer:
Caching stores previously used data in a faster location such as RAM. [1] If the same data is needed again, it can
be retrieved more quickly. [1] Caching is most useful when the same items are searched or accessed repeatedly.
[1] With very large data sets, caching everything may be unrealistic. [1] Concurrent processing allows several
processes or processors to work at overlapping times. [1] A large linear search could be split so different
processors search different sections. [1] This may reduce search time, but the speed-up is limited by bottlenecks
such as storage access. [1] Use caching for repeated searches and concurrency for large independent searches.
[1]

Page 9
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2019 - H446/02 Paper 2


Question:
Explain why a queue is used instead of a stack when data must be accessed in arrival order.

Answer:
A queue is first in first out. [1] It retrieves values in the same order they were recorded. [1] A stack is last in first
out. [1] It would retrieve the values in reverse order, which is unsuitable for arrival-order processing. [1]

Question:
Explain why dequeue() is a function rather than a procedure.

Answer:
dequeue() is a function because it returns the first item from the queue. [1] A procedure would carry out an action
without returning a value to the calling code. [1]

Question:
Describe what O(n), O(n^2) and O(1) mean for bubble sort.

Answer:
O(n) is linear time. [1] In the best case, the time grows in proportion to the number of items. [1] This occurs when
the data is already in order. [1] O(n^2) is quadratic time. [1] In the average or worst case, the time grows in
proportion to the square of the number of items. [1] Worst case is usually when the data begins in reverse order.
[1] O(1) space is constant extra memory. [1] Bubble sort uses the same amount of additional memory regardless
of the number of items. [1]

Question:
Explain the difference between branching and iteration.

Answer:
Branching chooses which code path is run, such as an if statement. [1] The selected branch runs once unless
another control structure repeats it. [1] Iteration repeatedly runs the same code while, until or for a condition. [1]

Question:
Describe the arithmetic operation MOD.

Answer:
MOD gives the remainder after integer division. [1] For example, 10 MOD 3 is 1 because 3 fits into 10 three times
with remainder 1. [1]

Question:
State one benefit and one drawback of using iteration instead of recursion.

Answer:
Iteration may run faster because it avoids repeated function calls. [1] Iteration cannot run out of call-stack space in
the way deep recursion can. [1] However, iteration can make code longer or more complex. [1] Some problems
are expressed more clearly or elegantly using recursion. [1]

Page 10
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Explain how decomposition can aid the design of a game program.

Answer:
Decomposition splits the game into sub-problems. [1] This makes the design more manageable and easier to
understand. [1] Each sub-problem can be tackled independently. [1]

Question:
Define pipelining and give an example of its use in a program.

Answer:
Pipelining is where the result from one process or procedure is passed into the next process. [1] For example, an
event-detection procedure can feed into another procedure that updates the program state. [1]

Question:
Discuss the use of an IDE rather than only a text editor when developing a program.

Answer:
An IDE provides tools that help write code, such as syntax colouring, predictive text and auto-correct. [1] These
can reduce spelling or syntax errors. [1] It provides debugging tools such as stepping, breakpoints and variable
watch windows. [1] These help locate logic errors by inspecting the program during execution. [1] The program
can often be run without leaving the development environment. [1] An IDE may integrate tools such as version
control for team development. [1] A text editor may be simpler and use fewer resources, but provides less
support. [1] An IDE is usually more appropriate for complex program development because debugging and
project support outweigh the overhead. [1]

Question:
Explain why insertion sort might use less memory than merge sort.

Answer:
Merge sort may create new arrays when it splits and merges the data. [1] Merge sort is often implemented
recursively, which adds data to the call stack. [1] Insertion sort sorts in place, so it does not require additional
arrays. [1]

Question:
Evaluate the use of data mining to improve a social networking website.

Answer:
Data mining extracts useful information from large data sets. [1] It looks for patterns or specific occurrences in
stored data. [1] It can identify which features users use most. [1] It can identify features that are rarely used and
may need redesign or removal. [1] It can identify characteristics of user groups to inform new features. [1] This
may help target advertising or improve user engagement. [1] It can save time and money by focusing
development on popular areas. [1] It must be handled carefully because privacy law and user trust are significant
issues. [1] Data mining is useful if there is enough relevant data and it is used ethically and legally. [1]

Page 11
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Give examples of abstraction in a program interface and explain why abstraction is needed.

Answer:
Abstraction can replace real images with labelled shapes. [1] It can show a simplified layout rather than every
real-world detail. [1] It removes irrelevant features that are not needed by the program. [1] This reduces the
complexity of the design. [1] It can reduce programming effort. [1] It can reduce memory and processing
requirements because detailed images or unnecessary information are not stored. [1]

Question:
Explain and evaluate the use of caching and reusable components in a program design.

Answer:
Caching stores data that has been used in a fast-access location in case it is needed again. [1] This can speed up
repeated access to items, requirements or layouts. [1] Reusable components are pieces of code that can be
called many times or used in multiple places. [1] Subroutines, classes and libraries can be reusable components.
[1] Reusable components can make later adaptation easier. [1] Caching can improve performance but uses extra
memory. [1] Reusable components require more careful upfront design. [1] Both are worthwhile when repeated
operations or repeated item types are expected. [1]

Page 12
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2020 - H446/02 Paper 2


Question:
State what is meant by abstraction and describe how it can be used in a tree model.

Answer:
Abstraction removes unnecessary detail from the problem. [1] A tree can represent real movements or states
using nodes and edges. [1] This hides details about the full real-world move and keeps only the information
needed by the algorithm. [1]

Question:
State why a tree may not be a binary search tree.

Answer:
A binary tree must have no more than two child nodes from any node. [1] A binary search tree must also be
ordered so values less than a node are on one side and greater values are on the other side. [1]

Question:
State the type of pointer used when a node does not point to any other node.

Answer:
A null pointer is used when a node has no next child or next node. [1]

Question:
Give similarities and differences between a tree and a graph.

Answer:
Both trees and graphs consist of nodes. [1] Both use edges or links to connect nodes. [1] A tree has a root node,
whereas a graph does not need one. [1] A tree does not contain cycles, whereas a graph can contain cycles. [1]

Question:
Explain why decomposition can help during program development.

Answer:
Decomposition splits a problem into smaller sub-problems. [1] Repeated decomposition creates smaller parts that
are easier to solve. [1] These parts can become modules or subroutines in the program. [1] Work can be divided
between programmers or teams so development can happen concurrently. [1]

Question:
Discuss the need for concurrent processing in an online ticket-selling system.

Answer:
Concurrent processing allows several processes or threads to be handled at overlapping times. [1] Multiple
customers may send requests to the server at the same time. [1] The server must allow several users to browse,
reserve or purchase tickets without waiting for one user to finish completely. [1] Record locking may be needed so
two customers cannot buy the same seat. [1] This improves responsiveness and supports realistic online
demand. [1] However, it makes programming more complex because shared data must be controlled safely. [1]

Page 13
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Compare recursion and iteration.

Answer:
Recursion solves a problem by a routine calling itself. [1] Iteration repeats a block of code using a loop. [1]
Recursion uses stack memory because each call stores its own state. [1] Iteration usually reuses the same
variables and may use less memory. [1] Recursion can express some problems more elegantly, but it can run out
of stack space if too many calls are made. [1]

Question:
Explain why an array parameter may be passed by reference rather than by value.

Answer:
Passing by reference allows the subroutine to change the original array. [1] When control returns to the main
program, the changes are still present. [1] Passing by value would create a copy, so the original array would not
be changed. [1] Passing by reference also avoids copying the whole array, which can use less memory. [1]

Question:
Compare merge sort, quick sort and insertion sort for small and large arrays.

Answer:
Insertion sort has simple logic and can be efficient for a small or nearly sorted array. [1] Its average and
worst-case time complexity is O(n^2), so it does not scale well for large arrays. [1] Merge sort has O(n log n) time
complexity, so it is more suitable for large arrays. [1] Merge sort may require extra memory because it creates or
stores sublists. [1] Quick sort has good average time complexity of O(n log n), but its worst case can be O(n^2).
[1] For large unsorted arrays, merge sort or quick sort is usually more suitable than insertion sort. [1]

Question:
Describe how a bubble sort works.

Answer:
A bubble sort compares adjacent pairs of items. [1] If a pair is in the wrong order, the two items are swapped. [1]
This continues to the end of the list for one pass. [1] After a pass, one item has moved to its correct position. [1]
The algorithm repeats passes until no swaps are needed or the maximum number of passes has been reached.
[1]

Question:
State the purpose of the head and tail pointers in a queue.

Answer:
The head pointer identifies the first item in the queue or the next item to remove. [1] The tail pointer identifies the
last item in the queue or where the next item will be added. [1]

Question:
Describe how a queue can be changed to work as a circular queue.

Answer:
When the head or tail pointer moves beyond the final array index, it is reset to 0. [1] This allows free spaces at the
start of the array to be reused. [1] A full queue check must detect when the tail would catch up with the head. [1]

Page 14
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe how a program could deal with different priorities in a queue.

Answer:
The program could use separate queues for different priority levels. [1] New items would be added to the queue
matching their priority. [1] Items from the highest-priority queue would be processed before lower-priority items.
[1] Alternatively, a linked list could insert higher-priority items closer to the front by adjusting pointers. [1]

Question:
State the purpose of the free list pointer and head pointer in a linked list.

Answer:
The free list pointer points to the next free node that can be used when adding data. [1] The head pointer points to
the first node in the linked list. [1]

Question:
Describe the difference between get methods and set methods.

Answer:
A get method returns or gives access to an attribute value. [1] A set method changes an attribute value, usually
using a parameter. [1]

Question:
Describe how a linked list can be searched by following pointers.

Answer:
The search starts at the head pointer. [1] The data in the current node is compared with the item being searched
for. [1] If it is not found, the next pointer is followed to the next node. [1] This repeats until the item is found or a
null pointer is reached. [1] A suitable found or not-found message can then be returned. [1]

Question:
Describe IDE features that help with debugging.

Answer:
Stepping runs the program one line at a time so the programmer can locate where an error occurs. [1]
Breakpoints stop execution at chosen lines so a section of code can be inspected. [1] A variable watch window
shows variable values as the program runs. [1] Syntax error highlighting or diagnostics helps identify syntax
errors in the code. [1]

Question:
Discuss how object-oriented techniques can make a linked list reusable.

Answer:
A class is a template that defines the attributes and methods for a linked list or node. [1] Objects can be
instantiated from the class whenever a new list or node is needed. [1] Encapsulation protects attributes by making
them private and controlling access through methods. [1] Inheritance allows a subclass to reuse attributes and
methods from a base class. [1] Overriding allows a subclass to replace a parent method with a more specific
version. [1] These techniques improve reuse, maintenance and modification of a linked-list library. [1]

Page 15
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2021 - H446/02 Paper 2


Question:
Describe how abstraction can be used when designing a game.

Answer:
Abstraction removes unnecessary details from the real-world situation. [1] Unneeded character or environment
features can be left out. [1] Complex real-world objects can be simplified into specific objects, shapes or stored
attributes. [1] This makes the game easier to design and program. [1]

Question:
Describe what is meant by concurrent processing.

Answer:
Concurrent processing means multiple processes appear to execute at the same time. [1] This can be done by
giving each process a slice of processor time or by using multiple processors. [1]

Question:
Explain why concurrent processing is needed in an online multiplayer system.

Answer:
Many users may send requests to the server at the same time. [1] The server must respond in a reasonable time
while still handling other users. [1] Concurrent processing allows different requests to be handled without one
user blocking all others. [1] Shared data may need protection, such as record locking, so users do not overwrite
each other's changes. [1]

Question:
Define a heuristic in relation to the A* algorithm.

Answer:
A heuristic is an estimate or rule of thumb. [1] In A*, it estimates the remaining distance or cost from a node to the
destination. [1] It helps decide which path to follow first, making the search more efficient. [1]

Question:
Evaluate how data mining can be used to improve a large online game.

Answer:
Data mining searches large amounts of data for useful patterns, trends or relationships. [1] It can identify how
users behave, such as when they play, which features they use and which actions they perform most often. [1]
This can guide future changes, such as adding popular features or removing unused ones. [1] It may increase
user engagement and revenue by making the game more appealing. [1] However, there may be privacy concerns
if user activity is collected or misused. [1]

Question:
State suitable Big O complexities for binary and linear search.

Answer:
A linear search has O(n) average time because the number of comparisons grows linearly with the number of
items. [1] A binary search has O(log n) average time because the search space is repeatedly halved. [1] Both
linear and binary search can have O(1) space complexity when no extra data structure is created. [1]

Page 16
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Identify when a linear search is more appropriate than a binary search.

Answer:
A linear search is more appropriate when the data is not sorted. [1] It can also be suitable for a very small list
where the overhead of binary search is not worthwhile. [1]

Question:
Describe how quicksort sorts data into ascending order.

Answer:
Quicksort chooses a pivot value. [1] Each value is compared with the pivot. [1] Values less than the pivot are
placed in the left sublist. [1] Values greater than the pivot are placed in the right sublist. [1] The same process is
repeated on each sublist until the data is sorted. [1]

Question:
Explain why quicksort is a divide-and-conquer algorithm.

Answer:
Quicksort divides the data into smaller subsets. [1] Each subset is sorted separately. [1] The sorted subsets are
then combined to form the final sorted list. [1]

Question:
Discuss the benefits of using an IDE rather than a text editor.

Answer:
An IDE combines tools such as an editor, compiler and run-time environment in one program. [1] Syntax
highlighting and error diagnostics help identify mistakes more quickly. [1] Auto-complete or auto-correct can
reduce spelling and syntax errors. [1] Breakpoints allow execution to stop at a chosen line during testing. [1]
Stepping lets the programmer run one line at a time to trace logic. [1] A variable watch window shows variable
values while the program runs. [1] This can reduce development and debugging time compared with using a plain
text editor. [1]

Question:
State the purpose of a constructor.

Answer:
A constructor creates or initialises a new instance of a class. [1]

Question:
Describe inheritance using a base class and subclasses.

Answer:
Inheritance occurs when a child or derived class takes attributes and methods from a parent or base class. [1]
The child class can also add extra attributes or methods of its own. [1]

Page 17
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Explain why pipelining can improve processor performance.

Answer:
Pipelining allows one instruction to be fetched while another is decoded and another is executed. [1] This reduces
the time that parts of the processor are idle. [1] More instructions can be processed over the same period of time.
[1]

Question:
State the purpose of two pointers used in a circular queue.

Answer:
One pointer identifies the first item in the queue, which is the next item to be removed. [1] Another pointer
identifies the last item or next free position where a new item will be added. [1]

Question:
Describe how enqueue works in a circular queue.

Answer:
The algorithm checks whether the queue is full before adding data. [1] If the queue is full, it returns a suitable
failure value. [1] If there is space, the new item is stored at the tail or next free position. [1] The tail pointer is then
moved to the next position. [1] If the tail moves beyond the last array index, it wraps around to 0. [1]

Question:
Explain why decomposing a problem can help a developer design a solution.

Answer:
Decomposition splits the problem into smaller chunks. [1] Smaller problems are more manageable and easier to
solve. [1] It can show where code can be reused. [1] It can also allow different programmers to work on different
parts. [1]

Question:
Describe the purpose of branching and iteration in an algorithm.

Answer:
Branching allows the program to make decisions based on a condition. [1] It can choose different actions
depending on stored values or user input. [1] Iteration repeats a set of instructions. [1] It is useful when each
element in a data structure must be processed. [1]

Question:
Compare global and local variables, parameters and efficiency.

Answer:
A local variable has scope only within the module or subroutine where it is declared. [1] A global variable can be
accessed throughout the program. [1] Local variables are removed from memory when the module ends, so they
can be more memory efficient. [1] Global variables remain in memory throughout execution. [1] If data is local, it
must be passed as a parameter or returned from a function. [1] Passing by reference gives access to the original
data, while passing by value sends a copy. [1] Global variables can make small programs simpler, but they can
reduce modularity and make errors harder to trace. [1]

Page 18
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe how a program could automatically generate a grid-based puzzle.

Answer:
The program can use random numbers to generate the grid size. [1] It can generate a horizontal size and vertical
size for the grid. [1] It can loop through each cell in the grid. [1] For each cell, it can randomly store a value such
as 0 or 1 to represent the cell state. [1]

Page 19
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2022 - H446/02 Paper 2


Question:
State the precondition for a binary search.

Answer:
The data being searched must be in order or sorted. [1]

Question:
Describe how a linear search works.

Answer:
The search item is compared with the first value in the list. [1] If it is not found, the search item is compared with
the next value. [1] This repeats until the item is found or the end of the list is reached. [1] The algorithm returns
the position if the item is found, or a suitable not-found value if it is not found. [1]

Question:
Explain the difference between passing by value and passing by reference.

Answer:
Passing by value gives the subprogram a copy of the original data. [1] Changes made inside the subprogram
affect only the copy. [1] Passing by reference gives the subprogram access to the original memory location. [1]
Changes made inside the subprogram can alter the original data and remain after the subprogram ends. [1]

Question:
Give one benefit and one drawback of using a global variable.

Answer:
A global variable can be accessed from any subprogram, so it does not need to be passed repeatedly as a
parameter. [1] A global variable remains in memory for the whole program execution, increasing memory use. [1]
It can also be altered unexpectedly by another part of the program, causing side effects. [1]

Question:
Identify IDE features that help programmers write and test code.

Answer:
Auto-complete suggests commands or identifiers, reducing typing and spelling errors. [1] Auto-indent formats
code inside structures, improving readability and reducing structural mistakes. [1] Syntax highlighting
colour-codes keywords and structures so errors are easier to spot. [1] Breakpoints stop the program at a chosen
line so variable values can be inspected. [1] A variable watch window displays values while the program runs. [1]
Stepping runs one line at a time to help locate logic errors. [1]

Question:
Describe benefits of creating reusable algorithms or program components.

Answer:
Reusable components save time because the same algorithm does not need to be written repeatedly. [1] They
reduce testing effort if the component has already been tested. [1] They can be used in other programs or stored
in a program library. [1]

Page 20
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Compare breadth-first and depth-first traversal of a tree.

Answer:
Breadth-first traversal visits the root and then all nodes connected at the next level before moving deeper. [1]
Depth-first traversal follows a branch as far as possible before moving to another branch. [1] Depth-first traversal
often uses backtracking when a leaf node is reached. [1] Breadth-first traversal is often better when the required
item is near the root. [1] Depth-first traversal may be better when the required item is deeper in the tree. [1]
Depth-first traversal can be written recursively, but very large trees may use substantial stack space. [1]

Question:
Define abstraction and decomposition.

Answer:
Abstraction is removing unnecessary detail and focusing only on the parts needed to solve the problem. [1]
Decomposition is breaking a problem down into smaller sub-problems. [1]

Question:
Explain why abstraction is useful when designing a program.

Answer:
Abstraction reduces memory requirements by removing unneeded detail. [1] It reduces processing requirements
because unnecessary features do not need to be handled. [1] It simplifies the problem being solved so the
programmer can focus on the important elements. [1]

Question:
Describe how caching can improve an algorithm or system.

Answer:
Caching stores data that has already been used in a faster location such as RAM or cache. [1] If the same data is
needed again, it can be retrieved more quickly. [1] Caching is useful when the same values, designs or results are
repeatedly accessed. [1]

Question:
Explain the difference between a directed graph and an undirected graph.

Answer:
In a directed graph, an edge or arc can only be followed in the direction shown. [1] In an undirected graph, an
edge can be followed in both directions. [1]

Question:
Give differences between a graph and a tree.

Answer:
A graph can have more than one path between nodes, while a tree has a hierarchical structure. [1] A graph does
not need a root node, while a tree has a root node. [1] A graph can contain cycles or loops, while a tree does not.
[1] A graph can be weighted, whereas a tree is normally used to show parent-child relationships. [1]

Page 21
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Explain how a graph can be an abstraction of a real problem.

Answer:
A graph can use nodes to represent important places, states or data items. [1] Edges can represent possible
connections between those nodes. [1] The graph leaves out unnecessary physical detail, such as the exact shape
of real routes. [1]

Question:
Compare Dijkstra's algorithm and A* as path-finding algorithms.

Answer:
Both algorithms can be used to find a shortest path. [1] Dijkstra's algorithm uses known edge weights from the
start node. [1] A* also uses a heuristic estimate of the distance to the target. [1] A* is usually more efficient when
the heuristic guides the search towards the target. [1] Dijkstra's algorithm does not need a heuristic. [1]

Question:
Define performance modelling and describe how it can be used.

Answer:
Performance modelling simulates or models the behaviour of a system before it is used. [1] It can test how the
system behaves with large or small inputs. [1] It can model how well the system scales as the number of users,
deliveries, routes or data items increases. [1]

Question:
Explain why a function is used rather than a procedure.

Answer:
A function is used when a value needs to be returned to the calling code. [1] A procedure carries out a task but
does not return a value in the same way. [1]

Question:
Identify features of a recursive function.

Answer:
A recursive function calls itself. [1] It has a base case or stopping condition that terminates the recursion. [1] Each
recursive call stores its own state, such as parameters and local variables, on the call stack. [1]

Question:
Describe the purpose of a stack pointer.

Answer:
A stack pointer identifies the top item in the stack. [1] It may also identify the next free space where a new item
will be pushed. [1] The pointer is updated when items are pushed or popped. [1]

Page 22
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe how head and tail pointers are used in a queue.

Answer:
The head pointer identifies the item that will be dequeued next. [1] The tail pointer identifies where the next item
will be enqueued. [1] Enqueueing updates the tail pointer. [1] Dequeueing updates the head pointer. [1]

Question:
Compare object-oriented and procedural approaches for implementing data structures.

Answer:
Object-oriented programming defines data structures as objects with attributes and methods. [1] Attributes can be
made private to reduce accidental changes. [1] Multiple instances of the same structure can be created without
rewriting the class. [1] Procedural programming executes statements and subroutines in sequence. [1] Procedural
code may require the structure to be passed into subroutines repeatedly. [1] Object-oriented programming can
reduce duplicated code and improve maintainability. [1]

Page 23
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2023 - H446/02 Paper 2


Question:
Give characteristics of a tree data structure.

Answer:
A tree is a hierarchical structure. [1] Data is stored in nodes. [1] Nodes are linked by branches or edges. [1] A tree
has a root node. [1] Nodes may have child nodes beneath them. [1] Nodes with no children are leaf nodes. [1] A
tree has no cycles or loops. [1]

Question:
Describe how a leaf node is deleted from a binary search tree.

Answer:
The tree is searched until the required leaf node is found. [1] The parent node's pointer to that leaf node is set to
null. [1] The deleted node can then be added to the free storage list or left for garbage collection. [1]

Question:
Describe how a binary search tree can be searched for a value.

Answer:
The search value is first compared with the root node. [1] If the root equals the search value, the value has been
found. [1] If the search value is less than the current node, the left subtree is searched. [1] If the search value is
greater than the current node, the right subtree is searched. [1] This process repeats until the value is found or
there are no further branches to follow. [1]

Question:
Explain how backtracking is used in a depth-first traversal.

Answer:
When a leaf node is reached, there are no further child nodes to visit from that branch. [1] The traversal returns to
the leaf node's parent. [1] It then backtracks to the most recent node that still has an unvisited child. [1]

Question:
Explain problem recognition and decomposition as computational thinking methods.

Answer:
Problem recognition identifies that there is a problem to solve and determines exactly what the problem is. [1] It
also considers whether the problem can be solved using computational methods. [1] Decomposition splits the
problem into smaller sub-problems that can be solved independently. [1] This helps identify inputs, outputs,
constraints and the main features that the program must handle. [1]

Question:
Explain the purpose of linked-list pointers such as headPointer, freeListPointer and null.

Answer:
The head pointer identifies the first element in the linked list. [1] The free-list pointer identifies the next free index
where new data can be stored. [1] A null pointer shows that a node does not point to another node. [1] Null can
therefore indicate the end of a linked list. [1]

Page 24
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe benefits of reusable functions or subroutines.

Answer:
One piece of code can be used many times in different places. [1] The same code does not need to be written
repeatedly. [1] Development takes less time because less code must be planned and coded. [1] Maintenance is
easier because a correction in one reusable routine affects every place it is used. [1]

Question:
Describe features of recursion.

Answer:
A recursive function calls itself. [1] Each recursive call creates a new copy of the function's values. [1] These
values are stored on a stack until the call returns. [1] A base case stops further recursive calls. [1]

Question:
Explain common Big O complexities.

Answer:
Big O describes how time or memory requirements change as the amount of data increases. [1] Constant
complexity does not change as the input size grows. [1] Linear complexity grows in proportion to the input size. [1]
Logarithmic complexity grows at a decreasing rate as the input size grows. [1] Exponential complexity grows very
quickly and can become unmanageable for large inputs. [1]

Question:
Define concurrent processing and give benefits.

Answer:
Concurrent processing allows processes to overlap in time. [1] One process can start before another process has
finished. [1] Processes may be given slices of processor time or run on different cores. [1] It can make better use
of processor time and reduce idle time. [1] It can allow a user to interact with the computer while other tasks
continue. [1]

Question:
Describe how merge sort works.

Answer:
The list is split into two smaller lists. [1] These sublists are repeatedly split until each sublist contains one item. [1]
The first items in two sublists are compared. [1] The smaller item is selected and written to a new list. [1] This
merging process repeats until all sorted sublists are recombined into one sorted list. [1]

Question:
Give one benefit and one drawback of merge sort compared with bubble sort.

Answer:
Merge sort has a more efficient time complexity for large data sets, such as O(n log n) rather than O(n^2). [1]
Merge sort uses divide and conquer and can be suitable for concurrent processing. [1] However, merge sort is
harder to implement than bubble sort. [1] Merge sort usually has worse space complexity because it needs extra
lists or stack space. [1]

Page 25
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Give IDE features and explain how they help debugging.

Answer:
Error diagnostics help locate and fix errors. [1] Breakpoints stop the program at chosen points so values can be
inspected. [1] Syntax highlighting identifies keywords, variables and likely syntax errors. [1] Stepping runs the
program line by line so the effect of each statement can be checked. [1] A variable watch window shows how
variable values change during execution. [1] Auto-complete reduces typing errors by completing commands or
identifiers. [1]

Question:
Define abstraction and explain why it is useful.

Answer:
Abstraction removes unnecessary detail from a problem. [1] It allows programmers to focus on the core aspects
of the problem. [1] It simplifies a complex problem so it is easier to solve. [1] It can reduce programming time. [1] It
can reduce memory use or computational power required. [1]

Question:
Define encapsulation.

Answer:
Encapsulation is the bundling of data with the methods that operate on that data. [1] It allows an attribute to be
accessed or changed only through methods. [1] This protects data from inappropriate direct access. [1]

Question:
Describe benefits of object-oriented programming.

Answer:
Classes can be reused in other programs. [1] Inheritance can extend existing classes instead of rewriting them.
[1] Classes can be modified or extended, improving maintainability. [1] Encapsulation makes debugging easier
because it limits how attributes can be changed. [1] Access to attributes can be restricted, improving security and
data integrity. [1] Classes can be distributed between team members, supporting team development. [1]

Question:
Compare local variables, global variables and parameters.

Answer:
A local variable can only be accessed within the subprogram or main program where it is declared. [1] A global
variable can be accessed by all subprograms. [1] A parameter is an item passed into a subprogram. [1] Passing
by value sends a copy, so the original value is not changed. [1] Passing by reference sends access to the original
value, so the original can be changed. [1] Global variables remain in memory throughout execution, which can
increase memory use. [1] Local variables and parameters reduce unwanted side effects because access is more
controlled. [1]

Page 26
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2024 - H446/02 Paper 2


Question:
Describe what is meant by a variable.

Answer:
A variable is a named memory location. [1] It stores a value or item of data. [1] The value stored in a variable can
be changed while the program runs. [1]

Question:
Describe the difference between a do loop and a while loop.

Answer:
A while loop checks its condition at the start of the loop. [1] This means the code in a while loop may never run.
[1] A do loop checks its condition at the end of the loop. [1] This means the code in a do loop will run at least
once. [1]

Question:
Evaluate the use of data mining.

Answer:
Data mining analyses patterns and anomalies in large data sets. [1] It turns large quantities of data into useful
information that may not be obvious to a human reader. [1] The information can be used to make predictions,
improve services, target advertising or increase revenue. [1] Data mining can identify which features are used
most or least. [1] It can identify difficult tasks or weak performance areas. [1] However, data mining finds patterns
but does not always explain why they occur. [1] Users may have privacy concerns if their activity is logged. [1]
Large-scale data mining can require significant processing power and security controls. [1] The data collection
must be legal and covered by appropriate terms or consent. [1]

Question:
Give differences between trees and graphs.

Answer:
A tree has one root node, while a graph does not have to have a root node. [1] A tree does not allow cycles or
loops, while a graph can. [1] A tree stores data hierarchically, while a graph does not need a hierarchy. [1] A tree
is connected, while a graph can be connected or disconnected. [1] A tree is normally undirected, while a graph
may be directed. [1]

Question:
Explain what heuristics are and when they are useful.

Answer:
A heuristic is a rule of thumb or educated guess. [1] It reduces the time taken to solve a problem by avoiding
exhaustive search. [1] It can find a solution that is good enough or close to the best solution. [1] In A*, a heuristic
can estimate the distance to the destination. [1] Heuristics are useful for complex, large-scale or time-critical
problems. [1] They may be less accurate because they do not examine every possibility. [1] They are suitable
where a perfect answer is not essential, such as many game AI decisions. [1]

Page 27
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe the roles of headPointer and tailPointer in a queue.

Answer:
The head pointer identifies the first item in the queue. [1] It also identifies which item will be dequeued next. [1]
The tail pointer identifies the next free space in the queue. [1] It also identifies where the next item will be
enqueued. [1]

Question:
Explain why a queue may be unsuitable when data needs to be resequenced.

Answer:
A queue is a first-in, first-out structure. [1] Items are processed in the order in which they were entered. [1] New
items can only be added at the rear of the queue. [1] The contents cannot be easily sorted or resequenced
without rewriting or using another structure. [1]

Question:
Describe how a pop operation works on a stack.

Answer:
The algorithm first checks whether the stack is empty. [1] If the stack is empty, it returns a suitable value or
warning. [1] If the stack is not empty, the stack pointer is decremented. [1] The value at the top position is
returned from the stack array. [1]

Question:
Describe how a linear search works.

Answer:
The first element is compared with the search item. [1] If the element matches the search item, the algorithm
returns the index or reports that it has been found. [1] If it does not match, the algorithm moves to the next
element. [1] This repeats until the item is found or the end of the list is reached. [1]

Question:
Explain the Big O terms linear, logarithmic, constant and exponential.

Answer:
Linear time means the time taken increases in direct proportion to the number of items. [1] Logarithmic space
means the additional memory grows at a decreasing rate as the number of items increases. [1] Constant
complexity means the requirement stays the same regardless of input size. [1] Exponential complexity means the
requirement grows at a rapidly increasing rate as input size increases. [1]

Question:
Explain why a record data structure can be suitable for storing related data.

Answer:
A record can store multiple items of data under one identifier. [1] A record can store fields of different data types.
[1] This makes it suitable when one item has several related properties, such as text, integer and real values. [1]

Page 28
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Give characteristics and benefits of a binary search tree.

Answer:
Each node in a binary search tree can have at most two child nodes. [1] Values are ordered so lower values are
placed to the left and higher values to the right. [1] The position where a new node is added depends on its order.
[1] Searching can be faster than searching an unordered structure. [1] The structure does not need to be sorted
again each time a new item is inserted. [1]

Question:
Compare depth-first post-order traversal and breadth-first traversal.

Answer:
Breadth-first traversal visits all nodes at the current depth before moving to the next depth. [1] Depth-first traversal
follows one branch to the end before moving to another branch. [1] Depth-first traversal uses backtracking. [1] In
post-order traversal, the root node is output last. [1] Breadth-first traversal does not output a binary search tree in
ascending order. [1]

Question:
Define abstraction and give benefits of using it.

Answer:
Abstraction is the removal of unnecessary detail. [1] It can simplify the problem, algorithm or program code. [1] It
can make the program faster to create. [1] It can reduce memory or processor use in the final program. [1] It
allows the programmer to focus on the core aspects of the problem. [1]

Question:
Define decomposition and give benefits of using it.

Answer:
Decomposition is splitting a problem into smaller sub-problems. [1] It helps identify individual components of the
solution. [1] It can show which components can be tackled concurrently. [1] It can identify reusable program
elements so the same algorithm is not created twice. [1] It allows work to be split between team members. [1] It
makes each smaller problem easier to write, test and debug. [1]

Question:
Explain why an array can be suitable for storing a fixed sequence of related objects.

Answer:
An array has a fixed number of positions when the number of required values is known. [1] It stores data linearly,
matching data that is arranged in a sequence. [1] Array elements can be directly accessed by index. [1] The array
can be iterated through to apply an operation to each position. [1] Its contents are mutable, so elements can be
added, changed or removed. [1]

Page 29
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Evaluate using global variables rather than local variables and parameters.

Answer:
Global variables are created when the program starts and can be accessed or updated by all subroutines. [1]
Local variables are created inside a subroutine and cannot be accessed directly elsewhere. [1] Local variables
are removed from memory when the subroutine ends. [1] Values can be passed to subroutines as parameters by
value or by reference. [1] Global variables can make a prototype easier to write because values do not need to be
passed repeatedly. [1] However, global variables stay in memory for the whole program and may become
memory-intensive as a program grows. [1] They can also create coupling, testing, debugging and maintenance
problems. [1] A larger program is usually better designed with local variables and parameters. [1]

Page 30
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

2025 - H446/02 Paper 2


Question:
Describe the steps a bubble sort takes to sort items into ascending order.

Answer:
A bubble sort compares adjacent pairs of items. [1] If the pair is already in the correct order, no swap is made. [1]
If the pair is in the wrong order, the items are swapped. [1] This comparison continues to the end of a pass. [1]
Passes are repeated until the list is sorted or the maximum number of passes has been reached. [1]

Question:
Explain how a bubble sort can be made more efficient.

Answer:
A swap flag can be used to record whether a swap has occurred in a pass. [1] If no swaps are made in a pass, the
algorithm can stop because the data is already sorted. [1]

Question:
Identify the type of iteration used by a for loop.

Answer:
A for loop is count-controlled or definite iteration. [1]

Question:
Describe the role of the partition function in quicksort.

Answer:
The partition function selects a pivot. [1] It compares each value with the pivot. [1] Values less than the pivot are
placed on one side and values greater than the pivot are placed on the other side. [1]

Question:
Describe what divide-and-conquer means.

Answer:
Divide-and-conquer breaks a problem into smaller sub-problems. [1] Each smaller sub-problem is solved
separately. [1] The smaller solutions are combined to produce the overall solution. [1]

Question:
Compare linear search and binary search for a large sorted file.

Answer:
A linear search checks items sequentially from the first item onwards. [1] It does not require the data to be sorted.
[1] Its average and worst-case time complexity is O(n), so search time grows linearly with the number of records.
[1] A binary search requires sorted data. [1] It repeatedly compares the target with the middle item and discards
half of the remaining search space. [1] Its average and worst-case time complexity is O(log n), so it scales much
better for a very large file. [1] Both searches can use O(1) extra space. [1] For a large sorted file, binary search
should be used because it is much more time-efficient. [1]

Page 31
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Describe what data mining means.

Answer:
Data mining analyses large quantities of data. [1] It converts data into useful information. [1] It identifies patterns,
trends, anomalies or relationships that may not be obvious to the user. [1]

Question:
Explain how data mining can improve a website and customer experience.

Answer:
Data mining can identify patterns in searches, views or purchases. [1] The company can use these patterns to
personalise adverts, recommend products, promote relevant features or stock more popular items. [1]

Question:
Discuss the use of pipelining by a processor.

Answer:
Pipelining divides instruction processing into stages such as fetch, decode and execute. [1] Different instructions
can be in different stages at the same time. [1] For example, one instruction can be fetched while another is
decoded and another is executed. [1] This reduces processor idle time and can increase instructions completed
per second. [1] It is especially useful when millions of instructions must be processed. [1] However, branch or
jump instructions may require the pipeline to be reset, reducing efficiency. [1]

Question:
Explain why a graph is a visualisation of a problem.

Answer:
A graph is a graphical representation of the problem. [1] It uses nodes to represent entities such as locations and
edges to represent links or routes between them. [1] This simplifies the problem and makes it easier to
understand. [1]

Question:
Describe how A* uses heuristics efficiently.

Answer:
A heuristic estimates the remaining cost or distance. [1] A* adds the heuristic to the distance already travelled to
choose the most promising next node. [1] It avoids exploring every possible route, which can speed up the
search. [1]

Question:
Identify and describe IDE features used for debugging.

Answer:
Breakpoints stop the program at set positions so the flow or variable contents can be checked. [1] Stepping runs
the code one line at a time so the programmer can trace execution. [1] A variable watch window displays variable
or data-structure contents while the program runs. [1] Error diagnostics locate or report details about errors. [1]

Page 32
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Explain the difference between global and local variables.

Answer:
A global variable is accessible throughout the program. [1] A local variable exists only within the scope in which it
is declared, such as a function or procedure. [1]

Question:
Describe drawbacks of using global variables.

Answer:
A global variable exists throughout the run-time of the program, which can waste memory. [1] It can make the
program harder to maintain because it may be difficult to see where the variable is changed. [1] A change in one
part of the program can affect another part, reducing data integrity. [1] Global variables can also reduce
modularity because modules are no longer fully self-contained. [1]

Question:
Describe drawbacks of using local variables.

Answer:
A local variable can only be accessed inside the subroutine where it is declared. [1] Data may need to be passed
as parameters or returned from functions. [1] This can make programming more complex or time-consuming. [1]

Question:
Describe what parameter passing by value means.

Answer:
The function receives a copy of the variable. [1] Changes are made to the copy, not the original value. [1] The
copy is deleted or becomes unavailable when the function ends. [1]

Question:
Describe the drawback of an unbalanced binary search tree.

Answer:
An unbalanced binary search tree can take longer to search. [1] In the worst case, searching may become O(n)
rather than O(log n). [1] More levels or iterations may need to be processed before the value is found. [1]

Question:
Describe features of a linked list data structure.

Answer:
A linked list has a head pointer that points to the first node. [1] Each node contains a data item and a pointer to
the next node. [1] The last node has a null pointer to indicate the end of the list. [1] Data must be accessed by
following pointers rather than by direct indexing. [1]

Page 33
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

Question:
Identify computational methods that can be used when designing a program.

Answer:
Problem recognition identifies what problem needs to be solved. [1] Decomposition splits the problem into smaller
sub-problems. [1] Abstraction removes unnecessary detail. [1] Other valid methods include backtracking,
heuristics, performance modelling, visualisation, algorithmic thinking and logical reasoning. [1]

Question:
Compare using object-oriented classes and a two-dimensional array to implement a linked list.

Answer:
An object-oriented approach can create a new node object whenever one is needed. [1] It does not require the
maximum number of nodes to be known in advance. [1] Classes can be reused in other programs with only small
changes. [1] Encapsulation can keep node attributes private and accessed through methods. [1] A
two-dimensional array implementation requires a fixed maximum size. [1] Unused array elements can waste
memory, but a free list can track where new nodes can be inserted. [1] The array method may be less flexible and
requires more pointer-management code. [1] The object-oriented method is usually more reusable and
memory-efficient for a general linked-list library. [1]

Page 34
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

High-Frequency Mark Scheme Method


Use these patterns whenever a question asks you to define, describe, explain, compare or evaluate Paper 2
theory. Build answers from precise definitions plus one or two consequences.

Decomposition
Define it as breaking a problem into smaller sub-problems. [1] Add that each part can be solved, coded or tested
separately. [1] Link to reuse, team working, easier debugging or simpler design. [1]

Abstraction
Define it as removing unnecessary detail. [1] State that only essential features are kept. [1] Link to reduced
complexity, reduced memory/processing requirements and focus on the core problem. [1]

Problem recognition
State that the first task is identifying exactly what problem must be solved. [1] Mention inputs, outputs, constraints
and whether a computational solution is possible. [1]

Algorithms and Big O


Big O describes how time or space grows as input size increases. [1] Use named forms: O(1) constant, O(log n)
logarithmic, O(n) linear, O(n^2) quadratic, O(2^n) exponential. [1] Always link the complexity to scalability, not just
speed. [1]

Searching and sorting


For search theory, state the precondition for binary search: sorted data. [1] For sort comparisons, compare both
time complexity and space complexity. [1] Mention that the same Big O does not mean identical real running time.
[1]

Stacks and queues


A stack is last in, first out. [1] A queue is first in, first out. [1] Always name the pointer involved: stack pointer, head
pointer or tail pointer. [1] For operations, mention underflow or overflow checks when relevant. [1]

Trees and graphs


A tree has a root, hierarchy and no cycles. [1] A graph uses nodes and edges and may have cycles, direction or
weights. [1] For traversal, breadth-first works level by level; depth-first follows a branch and backtracks. [1]

Functions, procedures and parameters


A function returns a value. [1] A procedure performs a task without returning a value in that way. [1] Passing by
value sends a copy; passing by reference gives access to the original. [1]

Recursion
A recursive routine calls itself. [1] It must have a base case. [1] Each call uses stack memory for its state, so
recursion can use more memory than iteration. [1]

Local and global variables


Local variables have limited scope and can be removed when the subroutine ends. [1] Global variables are
accessible throughout the program and stay in memory. [1] Global variables can simplify access but increase side
effects, coupling and debugging difficulty. [1]

OOP concepts
A class is a template for objects. [1] An object is an instance of a class. [1] Attributes store data and methods
define behaviour. [1] Encapsulation protects attributes by forcing access through methods. [1]

IDE features
Syntax highlighting helps identify keywords and errors. [1] Breakpoints pause execution at chosen lines. [1]
Stepping runs one line at a time. [1] A watch window shows variable values during execution. [1] Auto-complete

Page 35
Mark Scheme Method - OCR H446/02 Paper 2 Written Q&A

reduces typing mistakes. [1]

Evaluation answers
Give both sides. [1] Apply to the given context. [1] End with a justified judgement, such as which method is more
suitable and why. [1]

Concurrent processing
Define it as multiple processes executing at the same time or appearing to do so. [1] Link it to time slicing, threads
or multiple processors. [1] In server scenarios, mention multiple users and the need to protect shared data. [1]

Data mining
Define it as analysing large data sets to find patterns, trends, anomalies or hidden relationships. [1] Apply it to
user behaviour, recommendations, forecasting or targeted improvements. [1] Mention privacy or misuse concerns
in evaluation answers. [1]

Graph algorithms
For A*, define a heuristic as an estimated remaining cost. [1] State that distance travelled plus heuristic is used to
choose a promising next node. [1] For Dijkstra, emphasise known shortest distance from the start node rather
than a heuristic. [1]

Pipelining
State that instruction processing is split into stages such as fetch, decode and execute. [1] Explain that different
instructions can be in different stages at the same time. [1] Add that this reduces processor idle time, but
branching can reduce efficiency. [1]

End of Paper 2 written-theory booklet.

Page 36

You might also like