9618/21/M/J/24 question 3: worked solution (May/June 2024, paper 21)

Show as plain text

Cambridge AS Level Computer Science 9618 · 10.4 Introduction to Abstract Data Types (ADT) Worked solution from the Data Types and Structures Paper 2 Problem-solving and Programming booklet, Part 4 of 4. Q79 9618/21/M/J/24 original Q3 Structured · 8 marks Worked solution (a) Write all three of these points. The start pointer PS holds a null pointer, because the list is empty [1] The free list pointer PF points to the first element of the free list [1] All the nodes are in the free list [1] (b) The two variables will be of type Integer [1] The two variables will be used as pointers (indexes) to the arrays [1] The values stored in the two variables will indicate the first element of each list (the used list and the free list) [1] The first 1D array will be of type String , and will be used to store the data items (user IDs) [1] The second 1D array will be of type Integer , and will be used to store the pointers to the next item [1] KEY IDEA A linked list in arrays needs a data array, an integer pointer array and two integer start variables. TOTAL 8 marks Official mark scheme VIDEO ▶ Starts at Q3 (23:20) Starts at Q3 (23:20) · by Pseudocode Pro. Tap the picture to open it on YouTube.