Question 11(b) 2023 · May-June · Paper 31 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 11
Part (b)
Question 4
Show text version of question
Question 11
Part (b)
Question 11
Pseudocode is to be written to implement a queue Abstract Data Type (ADT) with items of the
string data type. This will be implemented using the information in the table.
Identifier Data type Description
FrontPointer INTEGER points to the start of the queue
RearPointer INTEGER points to the end of the queue
Length INTEGER the current size of the queue
Queue STRING 1D array to implement the queue
Part (b)
Complete the following pseudocode for the function Dequeue to remove the front item from
the queue.
FUNCTION Dequeue RETURNS STRING DECLARE Item : STRING
......................................................................................................................... > 0 THEN
Item ← .......................................................................................................................
...................................................................................................................................... IF Length = 0 THEN CALL Initialise // reset the pointers ELSE IF FrontPointer > MaxSize THEN
....................................................................................................................... ← 1 ENDIF ENDIF ELSE OUTPUT "The print queue was empty – error!" Item ← "" ENDIF RETURN Item ENDFUNCTION
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s23_qp_31.pdf
