Computational thinking and problem-solving
86 questions. Open a question to solve it and check the official answer.
Recursion · 1 mark · official answer ready
(ii) State the rule above which is recursive. Rule number is recursive. [1]
Recursion · 1 mark · official answer ready
(i) Copy a line from procedure InOrder that makes the procedure recursive. [1] 13
Recursion · 1 mark · official answer ready
(i) A BNF rule can be recursive. Explain what is meant by recursive. [1]
Recursion · 1 mark · official answer ready
(ii) State the rule above which is recursive. Rule number is recursive. [1]
Recursion · 1 mark · official answer ready
(i) Copy a line from procedure InOrder that makes the procedure recursive. [1] 13
Recursion · 1 mark · official answer ready
(i) A BNF rule can be recursive. Explain what is meant by recursive. [1]
Recursion · 1 mark · official answer ready
(ii) State the rule above which is recursive. Rule number is recursive. [1]
Recursion · 1 mark · official answer ready
(i) Copy the line from procedure ListTraversal that makes the procedure recursive. [1]
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]
