Wednesday 17 June 2026 – Morning
A Level Computer Science
H446/02 Algorithms and programming
Time allowed: 2 hours 30 minutes
You can use:
* 1 8 8 5 9 9 3 8 7 3 *
• a ruler (cm/mm)
• an HB pencil
Do not use:
• a calculator
* H 4 4 6 0 2 *
Please write clearly in black ink. Do not write in the barcodes.
Centre number Candidate number
First name(s)
Last name
INSTRUCTIONS
• Use black ink. You can use an HB pencil, but only for graphs and diagrams.
• Write your answer to each question in the space provided. If you need extra space use
the lined page at the end of this booklet. The question numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 140.
• The marks for each question are shown in brackets [ ].
• Quality of extended response will be assessed in questions marked with an
asterisk (*).
• This document has 40 pages.
ADVICE
• Read each question carefully before you start your answer.
© Cambridge OCR 2026 [601/4911/5] Cambridge OCR is an exempt Charity
DC (WW/CT) 378411/4 Turn over
for more:
, 2
BLANK PAGE
DO NOT WRITE ON THIS PAGE
© Cambridge OCR 2026
for more:
, 3
Section A
1 Data structures store data.
(a) One data structure is a stack.
(i) Give two characteristics of a stack.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
[2]
(ii) A function pop() removes an item of data from a stack.
Describe how the function pop() will work.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..................................................................................................................................................... [3]
© Cambridge OCR 2026 Turn over
for more:
, 4
(b) A second data structure is a queue.
A queue is stored as a 1-dimensional array of 100 integers with the identifier intQueue.
The queue has two pointers:
• head that stores a pointer to the first item in the queue. It has a starting value of –1
• tail that stores a pointer to the last item in the queue. It has a starting value of –1
(i) The function enqueue():
• takes an integer parameter to insert into the queue
• stores the parameter in the queue, updates the relevant pointer and returns true if the
queue is not full
• returns false if the queue is full.
Complete the function enqueue() using either pseudocode or program code.
function enqueue(insertData)
if tail > = ............................................ then
return false
endif
if head == ............................................ then
head = 0
tail = 0
else
tail = ............................................
endif
intQueue[............................................] = insertData
............................................
endfunction
[5]
© Cambridge OCR 2026
for more:
A Level Computer Science
H446/02 Algorithms and programming
Time allowed: 2 hours 30 minutes
You can use:
* 1 8 8 5 9 9 3 8 7 3 *
• a ruler (cm/mm)
• an HB pencil
Do not use:
• a calculator
* H 4 4 6 0 2 *
Please write clearly in black ink. Do not write in the barcodes.
Centre number Candidate number
First name(s)
Last name
INSTRUCTIONS
• Use black ink. You can use an HB pencil, but only for graphs and diagrams.
• Write your answer to each question in the space provided. If you need extra space use
the lined page at the end of this booklet. The question numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 140.
• The marks for each question are shown in brackets [ ].
• Quality of extended response will be assessed in questions marked with an
asterisk (*).
• This document has 40 pages.
ADVICE
• Read each question carefully before you start your answer.
© Cambridge OCR 2026 [601/4911/5] Cambridge OCR is an exempt Charity
DC (WW/CT) 378411/4 Turn over
for more:
, 2
BLANK PAGE
DO NOT WRITE ON THIS PAGE
© Cambridge OCR 2026
for more:
, 3
Section A
1 Data structures store data.
(a) One data structure is a stack.
(i) Give two characteristics of a stack.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
[2]
(ii) A function pop() removes an item of data from a stack.
Describe how the function pop() will work.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..................................................................................................................................................... [3]
© Cambridge OCR 2026 Turn over
for more:
, 4
(b) A second data structure is a queue.
A queue is stored as a 1-dimensional array of 100 integers with the identifier intQueue.
The queue has two pointers:
• head that stores a pointer to the first item in the queue. It has a starting value of –1
• tail that stores a pointer to the last item in the queue. It has a starting value of –1
(i) The function enqueue():
• takes an integer parameter to insert into the queue
• stores the parameter in the queue, updates the relevant pointer and returns true if the
queue is not full
• returns false if the queue is full.
Complete the function enqueue() using either pseudocode or program code.
function enqueue(insertData)
if tail > = ............................................ then
return false
endif
if head == ............................................ then
head = 0
tail = 0
else
tail = ............................................
endif
intQueue[............................................] = insertData
............................................
endfunction
[5]
© Cambridge OCR 2026
for more: