Question 2(b)(i) 2016 · May-June · Paper 43 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
(i)
Part (b)
(i)
Question 4
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9
Question 10
Question 1
Question 9
Question 3
Question 5
Question 8
Question 9
Question 13
Question 16
Question 27
Question 2
Question 3
Question 13
Question 4
Question 16
Question 5
Question 27
Question 6
Question 7
Question 8
Show text version of question
Question 2
Part (b)
(i)
The recursive procedure X is defined as follows:
01 PROCEDURE X(Index, Item) 02 IF MyList[Index] > 0 03 THEN 04 IF MyList(Index) >= Item 05 THEN 06 MyList[Index] ← MyList[Index + 1] 07 ENDIF 08 CALL X(Index + 1, Item) 09 ENDIF 10 ENDPROCEDURE
An array MyList is used to store a sorted data set of non-zero integers. Unused cells contain zero.
1 2 3 4 5 6 7 8 9 10
MyList 3 5 8 9 13 16 27 0 0 0
Question 5
(i)
Complete the trace table for the dry-run of the pseudocode for the procedure
CALL X(1, 9).
MyList Index Item 1 2 3 4 5 6 7 8 9 10
Why this question appears here
98% assigned-topic match · Computational thinking and problem-solving › Recursion
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 9608_s16_qp_43.pdf
