Computing 9691 · 19

19.2 Recursion

14 questions in this subtopic. Open a question to solve it and check the official answer.

Reset
2012 May-June · Paper 21 · Q5(a)

Recursion · 6 marks · official answer ready

(a) Calculate the value returned by the function call Happening(4). Show your working. Happening(4)= [6] 11

2012 May-June · Paper 21 · Q5(b)(i)

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…

2012 May-June · Paper 21 · Q5(b)(ii)

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]

2012 May-June · Paper 21 · Q5(c)

Recursion · 1 mark · official answer ready

(c) State what will happen if the function is called with Happening(-1). [1]

2012 May-June · Paper 21 · Q5(d)

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…

2012 May-June · Paper 22 · Q5(a)

Recursion · 6 marks · official answer ready

(a) Calculate the value returned by the function call Happening(4). Show your working. Happening(4)= [6] 11

2012 May-June · Paper 22 · Q5(b)(i)

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…

2012 May-June · Paper 22 · Q5(b)(ii)

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]

2012 May-June · Paper 22 · Q5(c)

Recursion · 1 mark · official answer ready

(c) State what will happen if the function is called with Happening(-1). [1]

2012 May-June · Paper 22 · Q5(d)

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…

2012 May-June · Paper 23 · Q5(a)

Recursion · 6 marks · official answer ready

(a) Calculate the value returned by the function call Something(4). Show your working. Something(4)= [6] 13

2012 May-June · Paper 23 · Q5(b)

Recursion · 1 mark · official answer ready

(b) State what will happen if the function is called with Something(8). For Examiner's Use [1]

2012 May-June · Paper 23 · Q5(c)

Recursion · 2 marks · official answer ready

(c) State what would happen if the fourth line, 'Something ← 1', was not present. [2]

2012 May-June · Paper 23 · Q5(d)

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…