19.2 Recursion
6 questions in this subtopic. Open a question to solve it and check the official answer.
Recursion · 17 marks · official answer ready
4 Look at this pseudocode function: FUNCTION Y(s : STRING) RETURNS STRING DECLARE x : INTEGER x LENGTH(s) IF x = 1 THEN RETURN s ELSE RETURN Y(RIGHT(s, x - 1)) + LEFT(s, 1) // RIG…
Recursion · 17 marks · official answer ready
4 Look at this pseudocode function: FUNCTION Y(s : STRING) RETURNS STRING DECLARE x : INTEGER x LENGTH(s) IF x = 1 THEN RETURN s ELSE RETURN Y(RIGHT(s, x - 1)) + LEFT(s, 1) // RIG…
Recursion · 2 marks · official answer ready
(a) A rule may be recursive. Explain what is meant by this and identify the rule above which is recursive. Rule number [2]
Recursion · 2 marks · official answer ready
(a) A rule may be recursive. Explain what is meant by this and identify the rule above which is recursive. Rule number [2]
Recursion · 1 mark
(i) A BNF rule can be recursive. State what is meant by recursive. [1]
Recursion · 1 mark · official answer ready
(ii) State the rule above which is recursive. Rule number [1]
