9618/33/M/J/25 question 13: worked solution (May/June 2025, paper 33)
Show as plain textHide plain text
Cambridge A2 Level Computer Science 9618 · 19.2 Recursion Worked solution from the Computational thinking and Problem-solving Paper 3 Advanced Theory booklet, Part 2 of 2. Q26 9618/33/M/J/25 original Q13 Structured · 4 marks Worked solution (a) Run Delete(1, 15) one call at a time. Nothing changes until Numbers[Index] >= 15. At Index 5, Numbers [5] takes the value of Numbers [6] , and each later cell copies the one after it. At Index 8 the value 0 is copied, and at Index 9 the cell is 0, so the calls stop. Index Target [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 2 3 7 11 15 17 19 23 0 0 1 15 2 3 4 5 17 6 19 7 23 8 0 9 Index (1 to 9) and Target (15) columns correct [1] Numbers [5] column correct (17) [1] Numbers [6] and Numbers [7] columns correct (19, 23) [1] Numbers [8] column correct (0), with no other data added to the other columns [1] KEY IDEA Trace a recursive procedure one call at a time, changing only the cells the code actually writes. TOTAL 4 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Craig'n'Dave. Tap the picture to open it on YouTube.