Paper & Mark Scheme (Merged) Wednesday 11 June 2025
[VERIFIED]
A-level
COMPUTER SCIENCE
Paper 1
Wednesday 11 June 2025 Morning Time allowed: 2 hours 30 minutes
Materials
For this paper you must have:
a computer
a printer
appropriate software
the Electronic Answer Document
an electronic version and a hard copy of the Skeleton Program
an electronic version and a hard copy of the Preliminary Material.
You must not use a calculator.
Instructions
Type the information required on the front of your Electronic Answer Document.
Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page (also at the top of the front
cover) of your Electronic Answer Document.
Enter your answers into the Electronic Answer Document.
Answer all questions.
Save your work at regular intervals.
Information
The marks for questions are shown in brackets.
The maximum mark for this paper is 100.
No extra time is allowed for printing and collating.
The question paper is divided into four sections.
Advice
You are advised to allocate time to each section as follows:
Section A – 40 minutes; Section B – 20 minutes; Section C – 20 minutes; Section D – 70 minutes.
At the end of the examination
Tie together all your printed Electronic Answer Document pages and hand them to the Invigilator.
Warning
It may not be possible to issue a result for this paper if your details are not on every page of your
Electronic Answer Document.
7 5 1 7 /1
for more: tyrionp ap ers .co m
IB/G/Jun25/G4002/E9
, 2
Section A
You are advised to spend no longer than 40 minutes on this section.
Enter your answers for Section A in your Electronic Answer Document.
You must save this document at regular intervals.
0 1 Two data structures that can be used to store a collection of data records are a hash
table and a sorted list.
0 1 . 1 Explain why a record in a hash table can normally be found more quickly than a
record in a sorted list.
[1 mark]
0 1 . 2 Describe the steps involved in adding a new record to a hash table.
[4 marks]
0 1 . 3 Explain why the time taken to find a specific record in a hash table can increase when
lots of records are stored in the table.
[1 mark]
Linear search and binary search are two algorithms that could be used to find a record
in a sorted list.
0 1 . 4 Explain why the linear search algorithm has time complexity of O(n).
[1 mark]
0 1 . 5 Explain why the binary search algorithm has time complexity of O(log n).
[1 mark]
0 1 . 6 State one advantage of a linear search compared to a binary search.
[1 mark]
If the list of records was unsorted, a bubble sort algorithm or a merge sort algorithm
could be used to sort the records.
0 1 . 7 Explain why both these sorting algorithms are tractable.
[1 mark]
0 1 . 8 After how many passes is bubble sort guaranteed to have sorted any list of
100 items?
[1 mark]
for more: tyrionpapers.com
IB/G/Jun25/7517/1
, 3
0 2 Define the term decomposition.
[2 marks]
Dijkstra’s algorithm is an example of a breadth-first traversal algorithm.
0 3 . 1 State the purpose of Dijkstra’s algorithm.
[1 mark]
Figure 1 shows a graph containing seven nodes.
Figure 1
0 3 . 2 State both the reasons why the graph in Figure 1 is not a tree.
[2 marks]
0 3 . 3 Complete the unshaded cells in Table 1 to show how the graph in Figure 1 could be
represented as an adjacency matrix.
Table 1
1 2 3 4 5 6 7
1
2
3
4
5
6
7
Copy the contents of the unshaded cells in Table 1 into the table in your
Electronic Answer Document.
[2 marks]
for more: tyrionTpu
aprenrs.o
covmer ►
IB/G/Jun25/7517/1
, 4
Figure 2 shows the graph in Figure 1 represented as an adjacency list, called AL.
An adjacency list is a list of lists.
Figure 2
Node Index
1 2 3
1 2 3 7
2 1 6
3 1 6 7
4 5
5 4
6 2 3
7 1 3
AL[1][3] is equal to 7 as it refers to the 3rd position in the list for node 1
LENGTH(AL[6]) is equal to 2 as there are two items in the list for node 6
Figure 3 contains pseudo-code for an algorithm that finds out if there is a path
between two nodes in the graph represented by the adjacency list AL. Both
subroutines in the algorithm make use of an array V.
Figure 3
SUBROUTINE IsPath(start, end)
FOR j = 1 TO LENGTH(AL)
V[j] = 0
END FOR
FOR j = 1 TO LENGTH(AL)
IF V[j] = 0 THEN
IF Traverse(start, end) = True THEN
RETURN True
END IF
END IF
END FOR
RETURN False
END SUBROUTINE
SUBROUTINE Traverse(start, end)
IF start = end THEN
RETURN True
END IF
V[start] = 1
FOR i = 1 TO LENGTH(AL[start])
IF V[AL[start][i]] = 0 THEN
IF Traverse(AL[start][i], end) = True THEN
RETURN True
END IF
END IF
END FOR
RETURN False
END SUBROUTINE
for more: tyrionpapers.com
IB/G/Jun25/7517/1