19.2 Recursion
80 questions in this subtopic. 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 [1]
Recursion · 17 marks
4 [4] (d) Re-write the pseudocode using a REPEAT – UNTIL loop. Make use of the techniques you gave in (c) to produce self-documented code. [6] 14 (e) (i) If Juan were to perform a…
Recursion · 7 marks
4 [4] (ii) Juan has written his program and one module appears not to work. Explain how Juan can use a break point and stepping to debug his program. [3] 15 4 Juan is also learnin…
Recursion · 1 mark
(b) State the line number which shows that this function is recursive. [1]
Recursion · 25 marks
(i) Trace the call Divisor(8, 2). Line number x y RETURN 0 8 2 [2]
Recursion · 27 marks
(ii) Trace the call Divisor(38, 7). Line number x y RETURN 0 38 7 [4] 15
Recursion · 24 marks
(i) State the purpose of line 1. For Examiner's Use [1]
Recursion · 24 marks
(ii) State what would happen if line 1 were not present. [1]
Recursion · 26 marks
(c) What happens if x is less than y? [3] 16 reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwitti…
Recursion · 4 marks
11 ENDIF 9 (f) Having entered a correct password, Aisha wants to present a menu screen. For The user is to enter a number between 1 and 4 to make a choice. Examiner's Use • Option…
Recursion · 14 marks
4 [4] (d) Re-write the pseudocode using a REPEAT – UNTIL loop. Make use of the techniques you used in your answer to part (c). [6] 16 (e) Ashvin will perform dry runs on the pseud…
Recursion · 6 marks
4 [4] (e) Ashvin will perform dry runs on the pseudocode using a trace table and a variety of test For data. He hopes to find any logic errors and avoid run-time errors occurring …
Recursion · 1 mark
(b) State the line number which shows that this function is recursive. [1]
Recursion · 1 mark · official answer ready
(i) What condition is put on the Customer array for a binary search to be used? [1] The following recursive function is for the binary search algorithm. FUNCTION BinarySearch(This…
Recursion · 1 mark · official answer ready
(ii) How can you recognise that the function is recursive? [1] 15
Recursion · 88 marks
25 passed_theory_test(X) AND passed_driving_test(X, V). These clauses have the following meaning: Clause Explanation 1 The minimum age for a car licence is 18 8 Shen is aged 21 13…
Recursion · 1 mark
25 passed_theory_test(X) AND passed_driving_test(X, V). These clauses have the following meaning: Clause Explanation 1 The minimum age for a car licence is 18 8 Shen is aged 21 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
