19.2 Recursion
14 questions in this subtopic. Open a question to solve it and check the official answer.
Recursion · 6 marks · official answer ready
(a) Calculate the value returned by the function call Happening(4). Show your working. Happening(4)= [6] 11
Recursion · 3 marks · official answer ready
(i) State two line numbers in the given pseudocode (other than lines 01 and 08) that For show the subroutine is a function. Give your reason for choosing these. Examiner's Use Lin…
Recursion · 2 marks · official answer ready
(ii) State the line number in the given pseudocode that shows the function is recursive. Give your reason for choosing this. Line number Reason [2]
Recursion · 1 mark · official answer ready
(c) State what will happen if the function is called with Happening(-1). [1]
Recursion · 4 marks · official answer ready
(d) The same process could have been solved iteratively using a FOR loop. Discuss the merits of iterative and recursive solutions to this problem, particularly when the initial va…
Recursion · 6 marks · official answer ready
(a) Calculate the value returned by the function call Happening(4). Show your working. Happening(4)= [6] 11
Recursion · 3 marks · official answer ready
(i) State two line numbers in the given pseudocode (other than lines 01 and 08) that For show the subroutine is a function. Give your reason for choosing these. Examiner's Use Lin…
Recursion · 2 marks · official answer ready
(ii) State the line number in the given pseudocode that shows the function is recursive. Give your reason for choosing this. Line number Reason [2]
Recursion · 1 mark · official answer ready
(c) State what will happen if the function is called with Happening(-1). [1]
Recursion · 4 marks · official answer ready
(d) The same process could have been solved iteratively using a FOR loop. Discuss the merits of iterative and recursive solutions to this problem, particularly when the initial va…
Recursion · 6 marks · official answer ready
(a) Calculate the value returned by the function call Something(4). Show your working. Something(4)= [6] 13
Recursion · 1 mark · official answer ready
(b) State what will happen if the function is called with Something(8). For Examiner's Use [1]
Recursion · 2 marks · official answer ready
(c) State what would happen if the fourth line, 'Something ← 1', was not present. [2]
Recursion · 2 marks · official answer ready
(d) The same process could have been designed using a FOR loop. Write the pseudocode to do this. [2] 14 15 16 reasonable effort has been made by the publisher (UCLES) to trace cop…
