Computer Science (AS & A Level) · May / June 2025 · Paper 22 · Question 6
9618
As printed in the paper
The question as text
Two arrays Data and Pointer are accessed by the procedure Place() Data and Pointer are both global arrays of type INTEGER The contents of these two arrays are shown: Data Pointer 1 1018 1 7 2 1007 2 3 3 1010 3 1 4 1056 4 6 5 1092 5 -1 6 1062 6 5 7 1034 7 4 8 0 8 9 9 0 9 10 10 0 10 -1 Study the pseudocode: PROCEDURE Place(Value : INTEGER, Start : INTEGER, Unused : INTEGER) DECLARE New, Current, Last : INTEGER CONSTANT NullPointer = -1 New Unused Last NullPointer Current Start WHILE Current <> NullPointer AND Data[Current] < Value Last Current Current Pointer[Current] ENDWHILE Pointer[New] Pointer[Last] Pointer[Last] New Data[New] Value ENDPROCEDURE
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
6(a)(i)[4]
6(a)(ii)[3]
6(b)[2]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

